-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some antivirus programs override CreateProcess() and run the child process initially in a sandbox, then after deciding the process is OK, they run it again for real. The initial instance of winpty-agent.exe connects to libwinpty's control pipe, then when the actual agent process starts later, it can't connect to the pipe because the pipe is in a disconnected/broken state. Work around the problem by creating multiple instances of the control pipe in libwinpty, then waiting on any of them to connect. An error on one pipe is logged to trace() but otherwise ignored as long as one of the pipes eventually connects. The error isn't reported until the agent dies or the connection has timed out. In practice, the initial sandbox connection's ConnectNamedPipe operation will probably succeed, but its child PID will be wrong, so this function quietly ignores verifyPipeClientPid failures (as long as one pipe succeeds). Fixes #142
- Loading branch information
Showing
1 changed file
with
197 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters