httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/winnt mpm_winnt.c
Date Wed, 06 Feb 2002 18:23:31 GMT
wrowe       02/02/06 10:23:31

  Modified:    server/mpm/winnt mpm_winnt.c
  Log:
    Give the child GENERIC_WRITE only to the stderr log channel,
    GENERIC_READ|GENERIC_WRITE to the scoreboard mapping,
    EVENT_MODIFY_STATE|SYNCHRONIZE to it's exit event,
    and fix a _major_ bug in the NullACL code that set the length
    by the size of the pointer-to-acl, rather than the size of an acl.
  
  Revision  Changes    Path
  1.225     +18 -18    httpd-2.0/server/mpm/winnt/mpm_winnt.c
  
  Index: mpm_winnt.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm_winnt.c,v
  retrieving revision 1.224
  retrieving revision 1.225
  diff -u -r1.224 -r1.225
  --- mpm_winnt.c	6 Feb 2002 08:14:11 -0000	1.224
  +++ mpm_winnt.c	6 Feb 2002 18:23:31 -0000	1.225
  @@ -254,8 +254,11 @@
       PSECURITY_ATTRIBUTES sa;
   
       sa  = (PSECURITY_ATTRIBUTES) LocalAlloc(LPTR, sizeof(SECURITY_ATTRIBUTES));
  -    pSD = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR,
  -					    SECURITY_DESCRIPTOR_MIN_LENGTH);
  +    sa->nLength = sizeof(sizeof(SECURITY_ATTRIBUTES));
  +
  +    pSD = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR, SECURITY_DESCRIPTOR_MIN_LENGTH);
  +    sa->lpSecurityDescriptor = pSD;
  +
       if (pSD == NULL || sa == NULL) {
           return NULL;
       }
  @@ -272,8 +275,7 @@
           LocalFree( sa );
           return NULL;
       }
  -    sa->nLength = sizeof(sa);
  -    sa->lpSecurityDescriptor = pSD;
  +
       sa->bInheritHandle = TRUE;
       return sa;
   }
  @@ -433,24 +435,23 @@
   
       for (lr = ap_listeners; lr; lr = lr->next) {
           apr_os_sock_get(&nsd,lr->sd);
  -        if (!DuplicateHandle(hProcess, (HANDLE) nsd, hProcess, &dup, 0,
  -                             FALSE,     /* Inherit flag */
  -                             DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) {
  -            ap_log_error(APLOG_MARK, APLOG_ERR, apr_get_os_error(), 
  -                         ap_server_conf,
  +        if (!DuplicateHandle(hProcess, (HANDLE) nsd, hProcess, &dup, 
  +                             0, FALSE, DUPLICATE_SAME_ACCESS)) {
  +            ap_log_error(APLOG_MARK, APLOG_ERR, apr_get_os_error(), ap_server_conf,
                            "set_listeners_noninheritable: DuplicateHandle failed.");
  -            return 0;
           }
  -        nsd = (SOCKET) dup;
  -        apr_os_sock_put(&lr->sd, &nsd, p);
  +        else {
  +            nsd = (SOCKET) dup;
  +            apr_os_sock_put(&lr->sd, &nsd, p);
  +        }
       }
   
       if (my_pid == parent_pid) {
           ap_log_error(APLOG_MARK, APLOG_INFO | APLOG_NOERRNO, 0, ap_server_conf,
  -                     "Parent: Marking listeners non-inherited.");
  +                     "Parent: Marked listeners as not inheritable.");
       } else {
           ap_log_error(APLOG_MARK, APLOG_INFO | APLOG_NOERRNO, 0, ap_server_conf,
  -                     "Child %d: Marking listeners non-inherited.", my_pid);
  +                     "Child %d: Marked listeners as not inheritable.", my_pid);
       }
       return 1;
   }
  @@ -1279,7 +1280,7 @@
       DWORD BytesWritten;
   
       if (!DuplicateHandle(hCurrentProcess, child_exit_event, hProcess, &hDup,
  -                         0, FALSE, DUPLICATE_SAME_ACCESS)) {
  +                         EVENT_MODIFY_STATE | SYNCHRONIZE, FALSE, 0)) {
           ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf,
                        "Parent: Unable to duplicate the exit event handle for the child");
           return -1;
  @@ -1298,7 +1299,7 @@
           return -1;
       }
       if (!DuplicateHandle(hCurrentProcess, hScore, hProcess, &hDup,
  -                         0, FALSE, DUPLICATE_SAME_ACCESS)) {
  +                         FILE_MAP_READ | FILE_MAP_WRITE, FALSE, 0)) {
           ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf,
                        "Parent: Unable to duplicate the scoreboard handle to the child");
           return -1;
  @@ -1439,7 +1440,7 @@
           if (rv == APR_SUCCESS && hShareError != INVALID_HANDLE_VALUE) {
               if (DuplicateHandle(hCurrentProcess, hShareError, 
                                   hCurrentProcess, &hDup, 
  -                                0, TRUE, DUPLICATE_SAME_ACCESS)) {
  +                                GENERIC_WRITE, TRUE, 0)) {
                   hShareError = hDup;
               }
               else {
  @@ -1465,7 +1466,6 @@
           else {
               hShareError = GetStdHandle(STD_ERROR_HANDLE);
           }
  -
       }
   
       /* Create the child_exit_event */
  
  
  

Mime
View raw message