From: Jeff Trawick Date: Fri, 22 Nov 2002 14:45:19 +0000 (+0000) Subject: Fix the building of cgi command lines when the query string X-Git-Tag: pre_ajp_proxy~2570 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd108a8478852a4b9e489b14a45dc36ad365ed2c;p=apache Fix the building of cgi command lines when the query string contains '='. PR: 13914 Submitted by: Ville Skytt� (mod_cgi) Jeff Trawick (mod_cgid) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97601 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 4d04e8ce38..8c521175e2 100644 --- 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ä , + 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 diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index c46692b37f..6cc13971d9 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -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, '=')) { diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 438817f27f..1e84e56200 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -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; + } } }