From: Todd C. Miller Date: Wed, 2 Feb 2011 18:27:24 +0000 (-0500) Subject: If we get a signal other than SIGCHLD in the monitor, pass it directly X-Git-Tag: SUDO_1_8_0~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a64a8c7988b1bd5ee78a49346fe2406ab097e5e;p=sudo If we get a signal other than SIGCHLD in the monitor, pass it directly to the child. --- diff --git a/src/exec_pty.c b/src/exec_pty.c index 6a21f9e18..fabaa54a6 100644 --- a/src/exec_pty.c +++ b/src/exec_pty.c @@ -943,7 +943,6 @@ exec_monitor(struct command_details *details, char *argv[], char *envp[], } if (FD_ISSET(signal_pipe[0], fdsr)) { - /* Read child status. */ n = read(signal_pipe[0], &signo, sizeof(signo)); if (n == -1) { if (errno == EINTR || errno == EAGAIN) @@ -951,11 +950,15 @@ exec_monitor(struct command_details *details, char *argv[], char *envp[], warning("error reading from signal pipe"); goto done; } - /* We should only ever get SIGCHLD. */ - if (signo == SIGCHLD) { + /* + * Handle SIGCHLD specially and deliver other signals + * directly to the child. + */ + if (signo == SIGCHLD) alive = handle_sigchld(backchannel, &cstat); - continue; - } + else + deliver_signal(child, signo); + continue; } if (errpipe[0] != -1 && FD_ISSET(errpipe[0], fdsr)) { /* read errno or EOF from command pipe */