]> granicus.if.org Git - sudo/commitdiff
Block all signals in Exit() to avoid a signal race. There is still a
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 17 Jan 2001 16:34:36 +0000 (16:34 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 17 Jan 2001 16:34:36 +0000 (16:34 +0000)
tiny window but I'm not going to worry about it.

visudo.c

index 09f3a19a682a54ed02535671d899a4ebb934e306..98943b65421b1b9d9d8dc1c81642de94cea901ba 100644 (file)
--- 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)