From: Dmitry Stogov Date: Tue, 27 Feb 2007 15:15:56 +0000 (+0000) Subject: reverted impersonation fix because of 4.4.6 release process X-Git-Tag: php-4.4.6~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1901a20ab73b9969afe586cf16212448b3983d04;p=php reverted impersonation fix because of 4.4.6 release process --- diff --git a/sapi/cgi/libfcgi/fcgiapp.c b/sapi/cgi/libfcgi/fcgiapp.c index c81b06a7d1..72df62014a 100644 --- a/sapi/cgi/libfcgi/fcgiapp.c +++ b/sapi/cgi/libfcgi/fcgiapp.c @@ -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 diff --git a/sapi/cgi/libfcgi/include/fcgios.h b/sapi/cgi/libfcgi/include/fcgios.h index 4a188fe2c5..f796456ab3 100644 --- a/sapi/cgi/libfcgi/include/fcgios.h +++ b/sapi/cgi/libfcgi/include/fcgios.h @@ -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) diff --git a/sapi/cgi/libfcgi/os_win32.c b/sapi/cgi/libfcgi/os_win32.c index 58172b952d..05306f9e6d 100644 --- a/sapi/cgi/libfcgi/os_win32.c +++ b/sapi/cgi/libfcgi/os_win32.c @@ -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; } +