]> granicus.if.org Git - sudo/commitdiff
SA_RESETHAND means the opposite of what I was thinking--oops
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 17 Feb 2001 21:11:41 +0000 (21:11 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 17 Feb 2001 21:11:41 +0000 (21:11 +0000)
To block all signals in old-style signals use ~0, not 0xffffffff

visudo.c

index 98943b65421b1b9d9d8dc1c81642de94cea901ba..35f31662b1a9e5d847a4c827390d4cc13d08d9a4 100644 (file)
--- a/visudo.c
+++ b/visudo.c
@@ -77,10 +77,6 @@ extern char *getenv  __P((const char *));
 extern int stat                __P((const char *, struct stat *));
 #endif /* !STDC_HEADERS */
 
-#if defined(POSIX_SIGNALS) && !defined(SA_RESETHAND)
-#define SA_RESETHAND    0
-#endif /* POSIX_SIGNALS && !SA_RESETHAND */
-
 #ifndef lint
 static const char rcsid[] = "$Sudo$";
 #endif /* lint */
@@ -577,8 +573,9 @@ setup_signals()
         */
 #ifdef POSIX_SIGNALS
        (void) memset((VOID *)&action, 0, sizeof(action));
+       sigemptyset(&sact.sa_mask);
+       action.sa_flags = 0;
        action.sa_handler = Exit;
-       action.sa_flags = SA_RESETHAND;
        (void) sigaction(SIGTERM, &action, NULL);
        (void) sigaction(SIGHUP, &action, NULL);
        (void) sigaction(SIGINT, &action, NULL);
@@ -659,10 +656,7 @@ Exit(sig)
     sigfillset(&mask);
     (void) sigprocmask(SIG_BLOCK, &mask, NULL);
 #else
-    unsigned int mask;
-
-    mask = 0xffffffff;
-    (void) sigblock((int) mask);
+    (void) sigblock(~0);
 #endif /* POSIX_SIGNALS */
 
     (void) unlink(stmp);