From: Todd C. Miller Date: Thu, 27 Apr 2017 02:17:34 +0000 (-0600) Subject: The fix for Bug #722 contained a typo/thinko that resulted in the X-Git-Tag: SUDO_1_8_20^2~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ee50beaa7f1bf61295a5b5960ac302fcc2e67fb;p=sudo 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. --- diff --git a/src/sudo.c b/src/sudo.c index 2fc8df873..1dd0409cb 100644 --- a/src/sudo.c +++ b/src/sudo.c @@ -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));