File mod_wsgi-setuid-patch.diff of Package apache2-mod_wsgi.openSUSE_13.1_Update

Index: mod_wsgi-3.4/mod_wsgi.c
===================================================================
--- mod_wsgi-3.4.orig/mod_wsgi.c
+++ mod_wsgi-3.4/mod_wsgi.c
@@ -10470,6 +10470,19 @@ static void wsgi_setup_access(WSGIDaemon
         ap_log_error(APLOG_MARK, WSGI_LOG_ALERT(errno), wsgi_server,
                      "mod_wsgi (pid=%d): Unable to change to uid=%ld.",
                      getpid(), (long)daemon->group->uid);
+
+        /*
+         * On true UNIX systems this should always succeed at
+         * this point. With certain Linux kernel versions though
+         * we can get back EAGAIN where the target user had
+         * reached their process limit. In that case will be left
+         * running as wrong user. Just exit on all failures to be
+         * safe. Don't die immediately to avoid a fork bomb.
+         */
+
+        sleep(20);
+
+        exit(-1);
     }
 }
 
openSUSE Build Service is sponsored by