mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Close standard handles in watchdog subprocesses.
Naturally, there's one really glaring goof I find out instants after 'git push'! If Pageant starts a watchdog subprocess which will wait until the main process terminates and then clean up the socket, then it had better not have that subprocess keep the standard I/O handles open, or else commands like eval $(pageant -X) won't terminate. I've applied the same fix in the X11 socket creation, though I think it's less critical there.
This commit is contained in:
parent
a081dd0a4c
commit
aa162bbca1
@ -159,6 +159,11 @@ int platform_make_x11_server(Plug *plug, const char *progname, int mindisp,
|
||||
* we expect read() to return EOF as soon as
|
||||
* that process terminates.
|
||||
*/
|
||||
|
||||
close(0);
|
||||
close(1);
|
||||
close(2);
|
||||
|
||||
setpgid(0, 0);
|
||||
close(cleanup_pipe[1]);
|
||||
close(authfd);
|
||||
|
@ -62,6 +62,11 @@ Socket *platform_make_agent_socket(
|
||||
* we expect read() to return EOF as soon as
|
||||
* that process terminates.
|
||||
*/
|
||||
|
||||
close(0);
|
||||
close(1);
|
||||
close(2);
|
||||
|
||||
setpgid(0, 0);
|
||||
close(cleanup_pipe[1]);
|
||||
while (read(cleanup_pipe[0], buf, sizeof(buf)) > 0);
|
||||
|
Loading…
Reference in New Issue
Block a user