apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr/threadproc/unix proc.c
Date Sat, 27 Oct 2001 00:48:19 GMT
trawick     01/10/26 17:48:19

  Modified:    threadproc/unix proc.c
  Log:
  back out previous change so that mod_cgid works again; add
  comment with a litte information about the problem with
  file cleanup conflicting with our pipe setup
  
  Submitted by:	Justin Erenkrantz
  
  Revision  Changes    Path
  1.52      +11 -3     apr/threadproc/unix/proc.c
  
  Index: proc.c
  ===================================================================
  RCS file: /home/cvs/apr/threadproc/unix/proc.c,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- proc.c	2001/10/26 18:13:02	1.51
  +++ proc.c	2001/10/27 00:48:19	1.52
  @@ -290,10 +290,16 @@
           int status;
           /* child process */
   
  -        /* do exec cleanup before duping pipes to fds 0-2; otherwise,
  -         * any files cleaned up with those fds will hose our pipes
  +        /* XXX major SNAFU
  +         *
  +         * If we do exec cleanup before the dup2() calls to set up pipes 
  +         * on 0-2, we accidentally close the pipes used by programs like 
  +         * mod_cgid.
  +         *
  +         * If we do exec cleanup after the dup2() calls, cleanup can accidentally
  +         * close our pipes which replaced any files which previously had
  +         * descriptors 0-2.
            */
  -        apr_pool_cleanup_for_exec();
   
           if (attr->child_in) {
               apr_file_close(attr->parent_in);
  @@ -318,6 +324,8 @@
                   exit(-1);   /* We have big problems, the child should exit. */
               }
           }
  +
  +        apr_pool_cleanup_for_exec();
   
           if ((status = limit_proc(attr)) != APR_SUCCESS) {
               return status;
  
  
  

Mime
View raw message