]> granicus.if.org Git - sudo/commitdiff
The fix for Bug #722 contained a typo/thinko that resulted in the
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 27 Apr 2017 02:17:34 +0000 (20:17 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 27 Apr 2017 02:17:34 +0000 (20:17 -0600)
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

index 2fc8df873529e338ecfe07c92ea9cec493908c88..1dd0409cbc926d523c4c55427053c24725c20b44 100644 (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));