]> granicus.if.org Git - sudo/commitdiff
Make sure that SIGCHLD is not treated as a user-generated signal
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 4 Nov 2014 16:24:41 +0000 (09:24 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 4 Nov 2014 16:24:41 +0000 (09:24 -0700)
in which case it could be ignored.  Bug #676

src/exec.c
src/exec_pty.c

index 2b53f3d069110f6b0e5b5e34d4bb225567b76754..7e993b3ef90bd4a448b1bae5ce649f2405ae0527 100644 (file)
@@ -895,7 +895,7 @@ handler(int s, siginfo_t *info, void *context)
      * kill itself.  For example, this can happen with some versions of
      * reboot that call kill(-1, SIGTERM) to kill all other processes.
      */
-    if (USER_SIGNALED(info)) {
+    if (s != SIGCHLD && USER_SIGNALED(info)) {
        pid_t si_pgrp = getpgid(info->si_pid);
        if (si_pgrp != (pid_t)-1) {
            if (si_pgrp == ppgrp || si_pgrp == cmnd_pid)
index c85e8f8f2e8b2e24a7fb8bfb352ceb1c0b7d1733..a31a02991fde46ec3d727a240b6654242f670e51 100644 (file)
@@ -147,7 +147,7 @@ mon_handler(int s, siginfo_t *info, void *context)
      * itself.  This can happen with, e.g., BSD-derived versions of
      * reboot that call kill(-1, SIGTERM) to kill all other processes.
      */
-    if (USER_SIGNALED(info)) {
+    if (s != SIGCHLD && USER_SIGNALED(info)) {
        pid_t si_pgrp = getpgid(info->si_pid);
        if (si_pgrp != (pid_t)-1) {
            if (si_pgrp == cmnd_pgrp)