From 9ee50beaa7f1bf61295a5b5960ac302fcc2e67fb Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 26 Apr 2017 20:17:34 -0600 Subject: [PATCH] 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. --- src/sudo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- 2.50.1