]> granicus.if.org Git - php/commitdiff
reverted impersonation fix because of 4.4.6 release process
authorDmitry Stogov <dmitry@php.net>
Tue, 27 Feb 2007 15:15:56 +0000 (15:15 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 27 Feb 2007 15:15:56 +0000 (15:15 +0000)
sapi/cgi/libfcgi/fcgiapp.c
sapi/cgi/libfcgi/include/fcgios.h
sapi/cgi/libfcgi/os_win32.c

index c81b06a7d11bb061a5cff3453e6114021e95d617..72df62014a519fa137a2c1c50f7a99bf4dc11188 100644 (file)
@@ -2061,10 +2061,6 @@ void FCGX_Free(FCGX_Request * request, int close)
         OS_IpcClose(request->ipcFd, ! request->detached);
         request->ipcFd = -1;
         request->detached = 0;
-#ifdef _WIN32
-    } else {
-        OS_StopImpersonation();
-#endif
     }
 }
 
@@ -2229,10 +2225,6 @@ int FCGX_Accept_r(FCGX_Request *reqDataPtr)
             if (reqDataPtr->ipcFd < 0) {
                 return (errno > 0) ? (0 - errno) : -9999;
             }
-#ifdef _WIN32
-               } else if (!OS_StartImpersonation()) {
-                       FCGX_Free(reqDataPtr, 1);
-#endif
         }
         /*
          * A connection is open.  Read from the connection in order to
index 4a188fe2c5aef1bd31ca7627c2f3a5e3395c1631..f796456ab344a606925f55506dc71199665ec024 100644 (file)
@@ -129,8 +129,6 @@ DLLAPI void OS_ShutdownPending(void);
 
 #ifdef _WIN32
 DLLAPI int OS_SetImpersonate(void);
-int OS_StartImpersonation(void);
-void OS_StopImpersonation(void);
 #endif
 
 #if defined (__cplusplus) || defined (c_plusplus)
index 58172b952d3db6e9e91136c3d0617df70980dd01..05306f9e6d0aec39a6d71c544654f1e310bd2745 100644 (file)
@@ -306,18 +306,6 @@ int OS_SetImpersonate(void)
        return 0;
 }
 
-int OS_StartImpersonation(void)
-{
-       return (!bImpersonate ||
-               ((hListen != INVALID_HANDLE_VALUE) && 
-                !ImpersonateNamedPipeClient(hListen)));
-}
-
-void OS_StopImpersonation(void)
-{
-       if (bImpersonate) RevertToSelf();
-}
-
 /*
  *--------------------------------------------------------------
  *
@@ -608,7 +596,7 @@ void OS_LibShutdown()
     if (stdioHandles[0] != INVALID_HANDLE_VALUE) {
                DisconnectNamedPipe(hListen);
                CancelIo(hListen);
-               OS_StopImpersonation();
+               if (bImpersonate) RevertToSelf();
        }
 
     WSACleanup();
@@ -1775,14 +1763,14 @@ static int acceptNamedPipe()
     //
     // impersonate the client
     //
-    if(bImpersonate && OS_StartImpersonation()) {
+    if(bImpersonate && !ImpersonateNamedPipeClient(hListen)) {
         DisconnectNamedPipe(hListen);
     } else {
                ipcFd = Win32NewDescriptor(FD_PIPE_SYNC, (int) hListen, -1);
                if (ipcFd == -1) 
                {
                        DisconnectNamedPipe(hListen);
-                       OS_StopImpersonation();
+                       if (bImpersonate) RevertToSelf();
                }
        }
 
@@ -1987,7 +1975,7 @@ int OS_IpcClose(int ipcFd, int shutdown)
 
         if (! DisconnectNamedPipe(fdTable[ipcFd].fid.fileHandle)) return -1;
 
-               OS_StopImpersonation();
+        if (bImpersonate) RevertToSelf();
 
         /* fall through */
     case FD_SOCKET_SYNC:
@@ -2061,3 +2049,4 @@ void OS_SetFlags(int fd, int flags)
     }
     return;
 }
+