OS_IpcClose(request->ipcFd, ! request->detached);
request->ipcFd = -1;
request->detached = 0;
-#ifdef _WIN32
- } else {
- OS_StopImpersonation();
-#endif
}
}
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
return 0;
}
-int OS_StartImpersonation(void)
-{
- return (!bImpersonate ||
- ((hListen != INVALID_HANDLE_VALUE) &&
- !ImpersonateNamedPipeClient(hListen)));
-}
-
-void OS_StopImpersonation(void)
-{
- if (bImpersonate) RevertToSelf();
-}
-
/*
*--------------------------------------------------------------
*
if (stdioHandles[0] != INVALID_HANDLE_VALUE) {
DisconnectNamedPipe(hListen);
CancelIo(hListen);
- OS_StopImpersonation();
+ if (bImpersonate) RevertToSelf();
}
WSACleanup();
//
// 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();
}
}
if (! DisconnectNamedPipe(fdTable[ipcFd].fid.fileHandle)) return -1;
- OS_StopImpersonation();
+ if (bImpersonate) RevertToSelf();
/* fall through */
case FD_SOCKET_SYNC:
}
return;
}
+