]> granicus.if.org Git - apache/commitdiff
Fix the building of cgi command lines when the query string
authorJeff Trawick <trawick@apache.org>
Fri, 22 Nov 2002 14:45:19 +0000 (14:45 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 22 Nov 2002 14:45:19 +0000 (14:45 +0000)
contains '='.

PR:              13914
Submitted by:  Ville Skytt� <ville.skytta@iki.fi> (mod_cgi)
                 Jeff Trawick (mod_cgid)

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

CHANGES
modules/generators/mod_cgi.c
modules/generators/mod_cgid.c

diff --git a/CHANGES b/CHANGES
index 4d04e8ce384d1503664973e2f6506ae2c660667b..8c521175e22f864c1522f9bf666d2ab580ea289d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
 Changes with Apache 2.0.44
 
+  *) Fix the building of cgi command lines when the query string
+     contains '='.  PR 13914  [Ville Skyttä <ville.skytta@iki.fi>,
+     Jeff Trawick]
+
   *) Replace APU_HAS_LDAPSSL_CLIENT_INIT with APU_HAS_LDAP_NETSCAPE_SSL
      as set by apr-util in util_ldap.c. This should allow mod_ldap
      to work with the Netscape/Mozilla LDAP library. [Øyvin Sømme
index c46692b37f55cd307676c1969ef5a1cf900ba983..6cc13971d9d46109f5e4cfc16632445d33847690 100644 (file)
@@ -514,7 +514,6 @@ static apr_status_t default_build_command(const char **cmd, const char ***argv,
 
     if (e_info->process_cgi) {
         *cmd = r->filename;
-        args = r->args;
         /* Do not process r->args if they contain an '=' assignment 
          */
         if (r->args && r->args[0] && !ap_strchr_c(r->args, '=')) {
index 438817f27f483bf191232b3bfa59d8747c7c0f15..1e84e56200ede0d4388c6421951ca9e9006dae61 100644 (file)
@@ -204,13 +204,13 @@ typedef struct {
     apr_size_t mod_userdir_user_len;
 } cgid_req_t;
 
-/* If a request includes query info in the URL (stuff after "?"), and
- * the query info does not contain "=" (indicative of a FORM submission),
- * then this routine is called to create the argument list to be passed
+/* This routine is called to create the argument list to be passed
  * to the CGI script.  When suexec is enabled, the suexec path, user, and
  * group are the first three arguments to be passed; if not, all three
  * must be NULL.  The query info is split into separate arguments, where
  * "+" is the separator between keyword arguments.
+ *
+ * Do not process the args if they containing an '=' assignment.
  */
 static char **create_argv(apr_pool_t *p, char *path, char *user, char *group,
                           char *av0, const char *args)
@@ -220,11 +220,16 @@ static char **create_argv(apr_pool_t *p, char *path, char *user, char *group,
     char *w;
     int idx = 0;
 
-    /* count the number of keywords */
-
-    for (x = 0, numwords = 1; args[x]; x++) {
-        if (args[x] == '+') {
-            ++numwords;
+    if (ap_strchr_c(args, '=')) {
+        numwords = 0;
+    }
+    else {
+        /* count the number of keywords */
+        
+        for (x = 0, numwords = 1; args[x]; x++) {
+            if (args[x] == '+') {
+                ++numwords;
+            }
         }
     }