]> granicus.if.org Git - apache/commitdiff
process_cgi is more descriptive than replace_cmd.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 13 Apr 2002 20:42:35 +0000 (20:42 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 13 Apr 2002 20:42:35 +0000 (20:42 +0000)
  It also affects query_string args.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94638 13f79535-47bb-0310-9956-ffa450edef68

modules/generators/mod_cgi.c
modules/generators/mod_cgi.h

index b0fd03600f9052dbb9d291901c93810866b16eb9..92c766318595da3feb36917da5f75278c4e0150e 100644 (file)
@@ -510,13 +510,13 @@ static apr_status_t run_cgi_child(apr_file_t **script_out,
 
 static apr_status_t default_build_command(const char **cmd, const char ***argv,
                                           request_rec *r, apr_pool_t *p,
-                                          int replace_cmd, apr_cmdtype_e * type)
+                                          int process_cgi, apr_cmdtype_e * type)
 {
     int numwords, x, idx;
     char *w;
-    const char *args = r->args;
+    const char *args = NULL;
 
-    if (replace_cmd) {
+    if (process_cgi) {
         /* Allow suexec's "/" check to succeed */
         const char *argv0 = strrchr(r->filename, '/');
         if (argv0 != NULL)
@@ -524,9 +524,15 @@ static apr_status_t default_build_command(const char **cmd, const char ***argv,
         else
             argv0 = r->filename;
         *cmd = argv0;
+        args = r->args;
+        /* Do not process r->args if they contain an '=' assignment 
+         */
+        if (r->args && r->args[0] && !ap_strchr_c(r->args, '=')) {
+            args = r->args;
+        }
     }
 
-    if (!args || !args[0] || ap_strchr_c(args, '=')) {
+    if (!args) {
         numwords = 1;
     }
     else {
index eec72ec43b2e0c8da0cbbff213a8911089c85c2b..b51d5cb0854c951d68b7902883877720b51f50d0 100644 (file)
@@ -67,8 +67,8 @@
  * @param argv Pointer to the arguments to pass (may be overridden)
  * @param r The current request
  * @param p The pool to allocate correct cmd/argv elements within.
- * @param replace_cmd Set true if r->filename is valid and may 
- *                    replace argv[0] and cmd, otherwise false
+ * @param process_cgi Set true if processing r->filename and r->args
+ *                    as a CGI invocation, otherwise false
  * @param type Set to APR_SHELLCMD or APR_PROGRAM on entry, may be
  *             changed to invoke the program with alternate semantics.
  * @remark This callback may be registered by the os-specific module 
@@ -78,6 +78,6 @@
 APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_cgi_build_command, 
                         (const char **cmd, const char ***argv,
                          request_rec *r, apr_pool_t *p, 
-                         int replace_cmd, apr_cmdtype_e *type));
+                         int process_cgi, apr_cmdtype_e *type));
 
 #endif /* _MOD_CGI_H */