httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r1099386 - /httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_unix.c
Date Wed, 04 May 2011 09:57:30 GMT
Author: pqf
Date: Wed May  4 09:57:30 2011
New Revision: 1099386

URL: http://svn.apache.org/viewvc?rev=1099386&view=rev
Log:
Handle exception while fcgid_create_privileged_process() fail. base on the patch from Igor
Seletskiy

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=1099386&r1=1099385&r2=1099386&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_unix.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_unix.c Wed May  4 09:57:30 2011
@@ -402,6 +402,7 @@ apr_status_t proc_spawn_process(const ch
     procnode->proc_id = tmpproc;
 
     if (rv != APR_SUCCESS) {
+        memset(&procnode->proc_id, 0, sizeof(procnode->proc_id));
         ap_log_error(APLOG_MARK, APLOG_ERR, rv, procinfo->main_server,
                      "mod_fcgid: can't run %s", wargv[0]);
     }
@@ -414,6 +415,11 @@ static apr_status_t proc_kill_internal(f
     /* su as root before sending signal, for suEXEC */
     apr_status_t rv;
 
+    if (procnode->proc_id.pid == 0) {
+        /* procnode->proc_id.pid be 0 while fcgid_create_privileged_process() fail */
+        return APR_SUCCESS; 
+    }
+
     if (ap_unixd_config.suexec_enabled && seteuid(0) != 0) {
 
         /* can't gain privileges to send signal (should not occur); do NOT
@@ -461,6 +467,7 @@ apr_status_t proc_wait_process(server_re
         /* Destroy pool */
         apr_pool_destroy(procnode->proc_pool);
         procnode->proc_pool = NULL;
+        memset(&procnode->proc_id, 0, sizeof(procnode->proc_id));
 
         return APR_CHILD_DONE;
     }



Mime
View raw message