]> granicus.if.org Git - sudo/commitdiff
Restore signal mask before calling reapchild(). Fixes a possible race
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 6 Feb 2007 18:23:45 +0000 (18:23 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 6 Feb 2007 18:23:45 +0000 (18:23 +0000)
condition that could prevent sudo from properly waiting for the child.

logging.c

index a6c773a366e7011a69b354a7ddc70b50811b5fd5..aafc77c709b0b644ff9cbfb3ea56d4838de43908 100644 (file)
--- a/logging.c
+++ b/logging.c
@@ -535,9 +535,9 @@ send_mail(line)
        get_timestr(), user_name, line);
     fclose(mail);
 
+    (void) sigprocmask(SIG_SETMASK, &oset, NULL);
     /* If mailer is done, wait for it now.  If not, we'll get it later.  */
     reapchild(SIGCHLD);
-    (void) sigprocmask(SIG_SETMASK, &oset, NULL);
 }
 
 /*