From: Todd C. Miller Date: Wed, 17 Jan 2001 16:34:36 +0000 (+0000) Subject: Block all signals in Exit() to avoid a signal race. There is still a X-Git-Tag: SUDO_1_6_4~208 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af80178b85984b7a8086ae8892387a94ec77de99;p=sudo Block all signals in Exit() to avoid a signal race. There is still a tiny window but I'm not going to worry about it. --- diff --git a/visudo.c b/visudo.c index 09f3a19a6..98943b654 100644 --- a/visudo.c +++ b/visudo.c @@ -653,6 +653,18 @@ static RETSIGTYPE Exit(sig) int sig; { +#ifdef POSIX_SIGNALS + sigset_t mask; + + sigfillset(&mask); + (void) sigprocmask(SIG_BLOCK, &mask, NULL); +#else + unsigned int mask; + + mask = 0xffffffff; + (void) sigblock((int) mask); +#endif /* POSIX_SIGNALS */ + (void) unlink(stmp); if (sig > 0)