From 0c8f8a7fc0ad05f4a386e35ee2b172e8f8e2ae9d Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Sat, 21 Jul 2012 15:39:09 +0200 Subject: [PATCH] Debian bug 531078: socat execs children with SIGCHLD ignored - fixed --- CHANGES | 3 +++ xio-progcall.c | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 2b23ad0..6d27ccd 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,9 @@ corrections: fixed a compile problem caused by size_t/socklen_t mismatch on 64bit systems + Debian bug 531078: socat execs children with SIGCHLD ignored; corrected + to default. Thanks to Martin Dorey for reporting this bug. + docu mentions option so-bindtodev but correct name is so-bindtodevice. Thanks to Jim Zimmerman for reporting. diff --git a/xio-progcall.c b/xio-progcall.c index 2cffb01..11cfb51 100644 --- a/xio-progcall.c +++ b/xio-progcall.c @@ -1,5 +1,5 @@ /* source: xio-progcall.c */ -/* Copyright Gerhard Rieger 2001-2009 */ +/* Copyright Gerhard Rieger 2001-2012 */ /* Published under the GNU General Public License V.2, see file COPYING */ /* this file contains common code dealing with program calls (exec, system) */ @@ -643,8 +643,10 @@ Warn1("xio-progcall.c: fd->howtoshut == %d", fd->howtoshut); gid_t group; if (withfork) { - if (Signal(SIGCHLD, SIG_IGN) == SIG_ERR) { - Warn1("signal(SIGCHLD, SIG_IGN): %s", strerror(errno)); + /* The child should have default handling for SIGCHLD. */ + /* In particular, it's not defined whether ignoring SIGCHLD is inheritable. */ + if (Signal(SIGCHLD, SIG_DFL) == SIG_ERR) { + Warn1("signal(SIGCHLD, SIG_DFL): %s", strerror(errno)); } /* dup2() the fds to desired values, close old fds, and apply late