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 2010/02/09 22:33:59 UTC

svn commit: r908237 - /httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_unix.c

Author: trawick
Date: Tue Feb  9 21:33:58 2010
New Revision: 908237

URL: http://svn.apache.org/viewvc?rev=908237&view=rev
Log:
When running apps under suexec, mod_fcgid registers a child
cleanup with the pool of the process in order to switch ids 
in the child prior to calling suexec.

As processes accumulated, this cleanup was run multiple times
in new child processes (unnecessary and unsuccessful).  Once
the fork() for the child has occurred, no-op the child cleanup
so that it won't affect subsequent child processes; they will
have their own pool with the child cleanup registered.

Modified:
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_unix.c

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_unix.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_unix.c?rev=908237&r1=908236&r2=908237&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_unix.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_unix.c Tue Feb  9 21:33:58 2010
@@ -345,6 +345,17 @@
                                          procattr, procinfo,
                                          procnode->proc_pool);
 
+    if (ap_unixd_config.suexec_enabled) {
+        /* Prior to creating the child process, a child cleanup was registered
+         * to switch the uid in the child.  No-op the child cleanup for this
+         * pool so that it won't run again as other child processes are created.
+         * (The cleanup will be registered for the pool associated with those
+         * processes too.)
+         */
+        apr_pool_child_cleanup_set(procnode->proc_pool, procnode,
+                                   socket_file_cleanup, apr_pool_cleanup_null);
+    }
+
     /* Close socket before try to connect to it */
     close(unix_socket);
     procnode->proc_id = tmpproc;