From: Todd C. Miller Date: Fri, 27 Aug 1999 21:02:24 +0000 (+0000) Subject: Only block SIGINT, SIGQUIT, SIGTSTP (which can be generated from X-Git-Tag: SUDO_1_6_0~74 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61bd59c733f1e6956e7d2413456e5c2baf73a622;p=sudo Only block SIGINT, SIGQUIT, SIGTSTP (which can be generated from the keyboard). Since we run with ruid/euid == 0 the user can't really signal us in nasty ways. --- diff --git a/sudo.c b/sudo.c index efca1bffa..bc39daacc 100644 --- a/sudo.c +++ b/sudo.c @@ -201,15 +201,17 @@ main(argc, argv) #endif /* POSIX_SIGNALS */ /* - * Block signals so the user cannot kill us at some point and + * Block signals so the user cannot interrupt us at some point and * avoid the logging. */ #ifdef POSIX_SIGNALS - (void) sigfillset(&set); - (void) sigdelset(&set, SIGCHLD); + (void) sigemptyset(&set); + (void) sigaddset(&set, SIGINT); + (void) sigaddset(&set, SIGQUIT); + (void) sigaddset(&set, SIGTSTP); (void) sigprocmask(SIG_BLOCK, &set, &oset); #else - omask = sigblock(sigmask(SIGHUP)|sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGILL)|sigmask(SIGTSTP)); + omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGTSTP)); #endif /* POSIX_SIGNALS */ /*