]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1889037 from trunk:
authorEric Covener <covener@apache.org>
Wed, 21 Apr 2021 01:10:58 +0000 (01:10 +0000)
committerEric Covener <covener@apache.org>
Wed, 21 Apr 2021 01:10:58 +0000 (01:10 +0000)
Pass NULL instead of a "null ACL"

Submitted By: Ivan Zhakov
Reviewed By: covener, ylavic (by inspection), ivan

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1889039 13f79535-47bb-0310-9956-ffa450edef68

os/win32/os.h
os/win32/util_win32.c
server/mpm/winnt/mpm_winnt.c

index 407c144d1984ffe6c9c67e0f00d72cb935018c60..3a32af57abe6d6539aa8482548aeeb642f86176d 100644 (file)
@@ -94,9 +94,6 @@ typedef enum {
 
 FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char* fnName, int ordinal);
 
-PSECURITY_ATTRIBUTES GetNullACL(void);
-void CleanNullACL(void *sa);
-
 #define AP_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \
     typedef rettype (calltype *ap_winapi_fpt_##fn) args; \
     static ap_winapi_fpt_##fn ap_winapi_pfn_##fn = NULL; \
index 86bd419f9fe011a750434569964673b9bc4ad981..728e4b5bd191a26c2a9b1be41292d3ccd24bd877 100644 (file)
@@ -101,48 +101,3 @@ FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char* fnName, int ordinal)
     else
         return GetProcAddress(lateDllHandle[fnLib], fnName);
 }
-
-
-/* To share the semaphores with other processes, we need a NULL ACL
- * Code from MS KB Q106387
- */
-PSECURITY_ATTRIBUTES GetNullACL(void)
-{
-    PSECURITY_DESCRIPTOR pSD;
-    PSECURITY_ATTRIBUTES sa;
-
-    sa  = (PSECURITY_ATTRIBUTES) LocalAlloc(LPTR, sizeof(SECURITY_ATTRIBUTES));
-    sa->nLength = sizeof(SECURITY_ATTRIBUTES);
-
-    pSD = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR, SECURITY_DESCRIPTOR_MIN_LENGTH);
-    sa->lpSecurityDescriptor = pSD;
-
-    if (pSD == NULL || sa == NULL) {
-        return NULL;
-    }
-    apr_set_os_error(0);
-    if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)
-        || apr_get_os_error()) {
-        LocalFree( pSD );
-        LocalFree( sa );
-        return NULL;
-    }
-    if (!SetSecurityDescriptorDacl(pSD, TRUE, (PACL) NULL, FALSE)
-        || apr_get_os_error()) {
-        LocalFree( pSD );
-        LocalFree( sa );
-        return NULL;
-    }
-
-    sa->bInheritHandle = FALSE;
-    return sa;
-}
-
-
-void CleanNullACL(void *sa)
-{
-    if (sa) {
-        LocalFree(((PSECURITY_ATTRIBUTES)sa)->lpSecurityDescriptor);
-        LocalFree(sa);
-    }
-}
index 38e13c183c1f895287d354845a6aa6c3c19720d9..1b8962e7457586775e6cbbdb1b16c0ac42bf3d4a 100644 (file)
@@ -1575,7 +1575,6 @@ static int winnt_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *pt
             /* This code should be run once in the parent and not run
              * across a restart
              */
-            PSECURITY_ATTRIBUTES sa = GetNullACL();  /* returns NULL if invalid (Win95?) */
             setup_signal_names(apr_psprintf(pconf, "ap%lu", parent_pid));
 
             ap_log_pid(pconf, ap_pid_fname);
@@ -1583,26 +1582,23 @@ static int winnt_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *pt
             /* Create shutdown event, apPID_shutdown, where PID is the parent
              * Apache process ID. Shutdown is signaled by 'apache -k shutdown'.
              */
-            shutdown_event = CreateEvent(sa, FALSE, FALSE, signal_shutdown_name);
+            shutdown_event = CreateEvent(NULL, FALSE, FALSE, signal_shutdown_name);
             if (!shutdown_event) {
                 ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf, APLOGNO(00448)
                              "Parent: Cannot create shutdown event %s", signal_shutdown_name);
-                CleanNullACL((void *)sa);
                 return HTTP_INTERNAL_SERVER_ERROR;
             }
 
             /* Create restart event, apPID_restart, where PID is the parent
              * Apache process ID. Restart is signaled by 'apache -k restart'.
              */
-            restart_event = CreateEvent(sa, FALSE, FALSE, signal_restart_name);
+            restart_event = CreateEvent(NULL, FALSE, FALSE, signal_restart_name);
             if (!restart_event) {
                 CloseHandle(shutdown_event);
                 ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf, APLOGNO(00449)
                              "Parent: Cannot create restart event %s", signal_restart_name);
-                CleanNullACL((void *)sa);
                 return HTTP_INTERNAL_SERVER_ERROR;
             }
-            CleanNullACL((void *)sa);
 
             /* Create the start mutex, as an unnamed object for security.
              * The start mutex is used during a restart to prevent more than