From 21166d4da9089e0af661ad5d167a58a7e71a9b98 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 4 Nov 2014 09:24:41 -0700 Subject: [PATCH] Make sure that SIGCHLD is not treated as a user-generated signal in which case it could be ignored. Bug #676 --- src/exec.c | 2 +- src/exec_pty.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/exec.c b/src/exec.c index 2b53f3d06..7e993b3ef 100644 --- a/src/exec.c +++ b/src/exec.c @@ -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) diff --git a/src/exec_pty.c b/src/exec_pty.c index c85e8f8f2..a31a02991 100644 --- a/src/exec_pty.c +++ b/src/exec_pty.c @@ -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) -- 2.40.0