mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-22 09:57:41 +00:00
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.
This commit is contained in:
parent
aeb8cefc42
commit
af80178b85
12
visudo.c
12
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user