One, win32 won't compile (nor any platform missing chown).  In this
case we didn't need it and have a good macro to look at.

This raised another bug in the next line.  We assumed because we
default to SYSV mutexes we should do that magic.  I believe this is
wrong, and we should be looking for that sort of lock explicitly.

Please review.

Bill
Index: modules/ssl/ssl_engine_mutex.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_mutex.c,v
retrieving revision 1.17.2.4
diff -u -r1.17.2.4 ssl_engine_mutex.c
--- modules/ssl/ssl_engine_mutex.c      30 Mar 2003 23:17:22 -0000      1.17.2.4
+++ modules/ssl/ssl_engine_mutex.c      31 Mar 2003 06:50:40 -0000
@@ -84,16 +84,21 @@
                          "Cannot create SSLMutex");
         return FALSE;
     }
+#if APR_HAS_FLOCK_SERIALIZE
     if (mc->szMutexFile && mc->ChownMutexFile == TRUE)
         chown(mc->szMutexFile, unixd_config.user_id, -1);
+#endif
 
-#if APR_USE_SYSVSEM_SERIALIZE
-    rv = unixd_set_global_mutex_perms(mc->pMutex);
-    if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
-                     "Could not set permissions on ssl_mutex; check User "
-                     "and Group directives");
-        return FALSE;
+#if APR_HAS_SYSVSEM_SERIALIZE
+    if (((mc->nMutexMech == APR_LOCK_DEFAULT) && APR_USE_SYSVSEM_SERIALIZE)
+            || (mc->nMutexMech == APR_LOCK_SYSVSEM)) {
+        rv = unixd_set_global_mutex_perms(mc->pMutex);
+        if (rv != APR_SUCCESS) {
+            ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
+                         "Could not set permissions on ssl_mutex; check User "
+                         "and Group directives");
+            return FALSE;
+        }
     }
 #endif
     return TRUE;


Reply via email to