The fix for Bug #722 contained a typo/thinko that resulted in the

exit status being 0 when a command was killed by a signal other
than SIGINT.  This fixes the signal handler setup so sudo will
terminate with the same signal as the command.  Bug #784.
This commit is contained in:
Todd C. Miller
2017-04-26 20:17:34 -06:00
parent 2180eab1f9
commit 9ee50beaa7

View File

@@ -322,7 +322,7 @@ main(int argc, char *argv[], char *envp[])
memset(&sa, 0, sizeof(sa));
sigemptyset(&sa.sa_mask);
sa.sa_handler = SIG_DFL;
sigaction(SIGINT, &sa, NULL);
sigaction(WTERMSIG(status), &sa, NULL);
sudo_debug_exit_int(__func__, __FILE__, __LINE__, sudo_debug_subsys,
WTERMSIG(status) | 128);
kill(getpid(), WTERMSIG(status));