]> granicus.if.org Git - sudo/commitdiff
Must reset signal handlers before we exec
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 9 Dec 2001 05:20:34 +0000 (05:20 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 9 Dec 2001 05:20:34 +0000 (05:20 +0000)
sudo.c

diff --git a/sudo.c b/sudo.c
index 10fbf81f090b9d473db8c22a4826461202d912e2..f61b2e967493e8fad09d4644ae27681d954c3247 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -333,6 +333,14 @@ main(argc, argv, envp)
                "please report this error at http://courtesan.com/sudo/bugs/");
        }
 
+       /* Reset signal handlers before we exec. */
+       sigemptyset(&sa.sa_mask);
+       sa.sa_flags = SA_RESTART;
+       sa.sa_handler = SIG_DFL;
+       (void) sigaction(SIGINT, &sa, NULL);
+       (void) sigaction(SIGQUIT, &sa, NULL);
+       (void) sigaction(SIGTSTP, &sa, NULL);
+
        /* Close the password file */
        endpwent();