httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/modules/generators mod_cgi.c mod_cgi.h
Date Sat, 13 Apr 2002 20:42:36 GMT
wrowe       02/04/13 13:42:36

  Modified:    modules/generators mod_cgi.c mod_cgi.h
  Log:
    process_cgi is more descriptive than replace_cmd.
  
    It also affects query_string args.
  
  Revision  Changes    Path
  1.133     +10 -4     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.132
  retrieving revision 1.133
  diff -u -r1.132 -r1.133
  --- mod_cgi.c	13 Apr 2002 19:52:59 -0000	1.132
  +++ mod_cgi.c	13 Apr 2002 20:42:35 -0000	1.133
  @@ -510,13 +510,13 @@
   
   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 @@
           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 {
  
  
  
  1.6       +3 -3      httpd-2.0/modules/generators/mod_cgi.h
  
  Index: mod_cgi.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgi.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- mod_cgi.h	13 Apr 2002 19:50:46 -0000	1.5
  +++ mod_cgi.h	13 Apr 2002 20:42:35 -0000	1.6
  @@ -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 */
  
  
  

Mime
View raw message