httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0 CHANGES
Date Sun, 26 May 2002 22:10:55 GMT
brianp      02/05/26 15:10:55

  Modified:    modules/generators mod_cgid.c
               .        CHANGES
  Log:
  Fix for suexec invocation of CGIs under user dirs when using cgid
  PR: 7810
  Submitted by:	Colm MacCarthaigh <colmmacc@redbrick.dcu.ie>
  Reviewed by:	Brian Pane
  
  Revision  Changes    Path
  1.130     +25 -17    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.129
  retrieving revision 1.130
  diff -u -r1.129 -r1.130
  --- mod_cgid.c	17 May 2002 11:33:09 -0000	1.129
  +++ mod_cgid.c	26 May 2002 22:10:55 -0000	1.130
  @@ -329,16 +329,8 @@
           if (rc != sizeof(int)) {
               return 1;
           }
  -        rc = read(fd, &suexec_cfg->ugid.uid, sizeof(uid_t));
  -        if (rc != sizeof(uid_t)) {
  -            return 1;
  -        }
  -        rc = read(fd, &suexec_cfg->ugid.gid, sizeof(gid_t));
  -        if (rc != sizeof(gid_t)) {
  -            return 1;
  -        }
  -        rc = read(fd, &suexec_cfg->active, sizeof(int));
  -        if (rc != sizeof(int)) {
  +        rc = read(fd, suexec_cfg, sizeof(*suexec_cfg));
  +        if (rc != sizeof(*suexec_cfg)) {
               return 1;
           }
           dconf[i] = (void *)suexec_cfg;
  @@ -379,12 +371,20 @@
       } 
   #endif 
   #endif
  -    /* For right now, just make the notes table.  At some point we will need
  -     * to actually fill this out, but for now we just don't want suexec to
  -     * seg fault.
  -     */
  +
  +    /* basic notes table to avoid segfaults */
       r->notes = apr_table_make(r->pool, 1);
   
  +    /* mod_userdir requires the mod_userdir_user note */
  +    rc = read(fd, &len, sizeof(len));
  +    if ((rc == sizeof(len)) && len) {
  +        data = apr_pcalloc(r->pool, len + 1); /* last byte is '\0' */
  +        rc = read(fd, data, len);
  +        if(rc != len) {
  +	    return 1;
  +        }
  +	apr_table_set(r->notes,"mod_userdir_user", data);
  +    }
       return 0;
   } 
   
  @@ -441,9 +441,7 @@
                                                              suexec_mod);
   
           write(fd, &suexec_mod->module_index, sizeof(int));
  -        write(fd, &suexec_cfg->ugid.uid, sizeof(uid_t));
  -        write(fd, &suexec_cfg->ugid.gid, sizeof(gid_t));
  -        write(fd, &suexec_cfg->active, sizeof(int));
  +        write(fd, suexec_cfg, sizeof(*suexec_cfg));
       }
   
   #if 0
  @@ -483,6 +481,16 @@
       } 
   #endif
   #endif 
  +   /* send a minimal notes table */
  +   data  = (char *) apr_table_get(r->notes, "mod_userdir_user");
  +   if(data != NULL) {
  +       len = strlen(data);
  +       write(fd, &len, sizeof(len));
  +       write(fd, data, len);
  +   } else {
  +       len = 0;
  +       write(fd, &len, sizeof(len));
  +   }
   } 
   
   static void daemon_signal_handler(int sig)
  
  
  
  1.789     +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.788
  retrieving revision 1.789
  diff -u -r1.788 -r1.789
  --- CHANGES	26 May 2002 08:27:10 -0000	1.788
  +++ CHANGES	26 May 2002 22:10:55 -0000	1.789
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.37
   
  +  *) Fix the combination of mod_cgid, mod_setuexec, and mod_userdir.
  +     PR 7810  [Colm MacCarthaigh <colmmacc@redbrick.dcu.ie>]
  +
     *) Fix suexec execution of CGI scripts from mod_include.
        PR 7791, 8291  [Colm MacCarthaigh <colmmacc@redbrick.dcu.ie>]
   
  
  
  

Mime
View raw message