From 01c7840dc57534a9fc83622dfc8a9977f85a2a2d Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 14 Sep 2010 09:23:19 -0400 Subject: [PATCH] Reset signal mask at sudo startup time; we need to be able to rely on normal signal delivery to control the child process. --- src/sudo.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sudo.c b/src/sudo.c index 140d4948b..03a63efcf 100644 --- a/src/sudo.c +++ b/src/sudo.c @@ -111,6 +111,7 @@ main(int argc, char *argv[], char *envp[]) char **user_info, **command_info, **argv_out, **user_env_out; struct plugin_container *plugin, *next; struct command_details command_details; + sigset_t mask; int ok; #if defined(SUDO_DEVEL) && defined(__OpenBSD__) extern char *malloc_options; @@ -129,7 +130,9 @@ main(int argc, char *argv[], char *envp[]) if (geteuid() != 0) errorx(1, "must be setuid root"); - /* Turn off core dumps and make sure fds 0-2 are open. */ + /* Reset signal mask, disable core dumps and make sure fds 0-2 are open. */ + (void) sigfillset(&mask); + (void) sigprocmask(SIG_UNBLOCK, &mask, NULL); disable_coredumps(); fix_fds();