]> granicus.if.org Git - apache/commitdiff
*) mod_cgid: Explicitly set permissions of the socket (ScriptSock) shared by
authorEric Covener <covener@apache.org>
Thu, 8 May 2008 00:09:53 +0000 (00:09 +0000)
committerEric Covener <covener@apache.org>
Thu, 8 May 2008 00:09:53 +0000 (00:09 +0000)
   mod_cgid and request processing threads, for OS'es such as HPUX and AIX
   that do not use umask for AF_UNIX socket permissions.
   [Eric Covener, Jeff Trawick]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@654332 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/generators/mod_cgid.c

diff --git a/CHANGES b/CHANGES
index bdb4c6a1474d043578e847d3311decc20f40b2a4..09ac6fa9d252f2150f77df35636348191213d71b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,11 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) mod_cgid: Explicitly set permissions of the socket (ScriptSock) shared by
+     mod_cgid and request processing threads, for OS'es such as HPUX and AIX
+     that do not use umask for AF_UNIX socket permissions.
+     [Eric Covener, Jeff Trawick]
+
   *) mod_cgid: Don't try to restart the daemon if it fails to initialize
      the socket.  [Jeff Trawick]
 
index 670a4734b1bcf80a46e7db11c5864195ce1fbc0f..c825e3680f860dfc461f87220527127686825edc 100644 (file)
@@ -573,6 +573,7 @@ static int cgid_server(void *data)
     apr_pool_t *ptrans;
     server_rec *main_server = data;
     apr_hash_t *script_hash = apr_hash_make(pcgi);
+    apr_status_t rv;
 
     apr_pool_create(&ptrans, pcgi);
 
@@ -607,6 +608,15 @@ static int cgid_server(void *data)
         return errno;
     }
 
+    /* Not all flavors of unix use the current umask for AF_UNIX perms */
+    rv = apr_file_perms_set(sockname, APR_FPROT_UREAD|APR_FPROT_UWRITE|APR_FPROT_UEXECUTE);
+    if (rv != APR_SUCCESS) {
+        ap_log_error(APLOG_MARK, APLOG_CRIT, rv, main_server,
+                     "Couldn't set permissions on unix domain socket %s",
+                     sockname);
+        return rv;
+    }
+
     if (listen(sd, DEFAULT_CGID_LISTENBACKLOG) < 0) {
         ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server,
                      "Couldn't listen on unix domain socket");