You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2002/11/22 15:45:19 UTC

cvs commit: httpd-2.0/modules/generators mod_cgi.c mod_cgid.c

trawick     2002/11/22 06:45:19

  Modified:    .        CHANGES
               modules/generators mod_cgi.c mod_cgid.c
  Log:
  Fix the building of cgi command lines when the query string
  contains '='.
  
  PR:              13914
  Submitted by:	 Ville Skytt� <vi...@iki.fi> (mod_cgi)
                   Jeff Trawick (mod_cgid)
  
  Revision  Changes    Path
  1.994     +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.993
  retrieving revision 1.994
  diff -u -r1.993 -r1.994
  --- CHANGES	22 Nov 2002 12:51:02 -0000	1.993
  +++ CHANGES	22 Nov 2002 14:45:18 -0000	1.994
  @@ -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� <vi...@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
  
  
  
  1.149     +0 -1      httpd-2.0/modules/generators/mod_cgi.c
  
  Index: mod_cgi.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgi.c,v
  retrieving revision 1.148
  retrieving revision 1.149
  diff -u -r1.148 -r1.149
  --- mod_cgi.c	31 Oct 2002 11:53:43 -0000	1.148
  +++ mod_cgi.c	22 Nov 2002 14:45:19 -0000	1.149
  @@ -514,7 +514,6 @@
   
       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, '=')) {
  
  
  
  1.146     +13 -8     httpd-2.0/modules/generators/mod_cgid.c
  
  Index: mod_cgid.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgid.c,v
  retrieving revision 1.145
  retrieving revision 1.146
  diff -u -r1.145 -r1.146
  --- mod_cgid.c	15 Nov 2002 02:49:29 -0000	1.145
  +++ mod_cgid.c	22 Nov 2002 14:45:19 -0000	1.146
  @@ -204,13 +204,13 @@
       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 @@
       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;
  +            }
           }
       }