You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2021/04/21 01:10:59 UTC

svn commit: r1889039 - in /httpd/httpd/branches/2.4.x: ./ os/win32/os.h os/win32/util_win32.c server/mpm/winnt/mpm_winnt.c

Author: covener
Date: Wed Apr 21 01:10:58 2021
New Revision: 1889039

URL: http://svn.apache.org/viewvc?rev=1889039&view=rev
Log:
Merge r1889037 from trunk:

Pass NULL instead of a "null ACL"

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


Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/os/win32/os.h
    httpd/httpd/branches/2.4.x/os/win32/util_win32.c
    httpd/httpd/branches/2.4.x/server/mpm/winnt/mpm_winnt.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1889037

Modified: httpd/httpd/branches/2.4.x/os/win32/os.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/os/win32/os.h?rev=1889039&r1=1889038&r2=1889039&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/os/win32/os.h (original)
+++ httpd/httpd/branches/2.4.x/os/win32/os.h Wed Apr 21 01:10:58 2021
@@ -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; \

Modified: httpd/httpd/branches/2.4.x/os/win32/util_win32.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/os/win32/util_win32.c?rev=1889039&r1=1889038&r2=1889039&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/os/win32/util_win32.c (original)
+++ httpd/httpd/branches/2.4.x/os/win32/util_win32.c Wed Apr 21 01:10:58 2021
@@ -101,48 +101,3 @@ FARPROC ap_load_dll_func(ap_dlltoken_e f
     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);
-    }
-}

Modified: httpd/httpd/branches/2.4.x/server/mpm/winnt/mpm_winnt.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/mpm/winnt/mpm_winnt.c?rev=1889039&r1=1889038&r2=1889039&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/mpm/winnt/mpm_winnt.c (original)
+++ httpd/httpd/branches/2.4.x/server/mpm/winnt/mpm_winnt.c Wed Apr 21 01:10:58 2021
@@ -1575,7 +1575,6 @@ static int winnt_post_config(apr_pool_t
             /* 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
             /* 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