diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2021-02-11 17:38:53 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2021-02-11 17:38:53 +0000 |
commit | c0e09dfe5ff3630f914f1008941a1cfdacbd3db2 (patch) | |
tree | fbd1629012b6c6d1ec11c32b8010814616e6eae8 /src/supervision/s6-supervise.c | |
parent | 4d157070b438574bb7c5c30cb62a135f056b4289 (diff) | |
download | s6-c0e09dfe5ff3630f914f1008941a1cfdacbd3db2.tar.xz |
bugfix: unignore SIGPIPE before execing a user-controlled process
Diffstat (limited to 'src/supervision/s6-supervise.c')
-rw-r--r-- | src/supervision/s6-supervise.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/supervision/s6-supervise.c b/src/supervision/s6-supervise.c index a175f0a..bda8e52 100644 --- a/src/supervision/s6-supervise.c +++ b/src/supervision/s6-supervise.c @@ -268,6 +268,7 @@ static void trystart (void) char const *cargv[2] = { "run", 0 } ; PROG = "s6-supervise (child)" ; selfpipe_finish() ; + sig_restore(SIGPIPE) ; if (notifyp[0] >= 0) close(notifyp[0]) ; close(p[0]) ; if (notifyp[1] >= 0 && fd_move((int)fd, notifyp[1]) < 0) @@ -391,6 +392,7 @@ static int uplastup_z (void) char fmt1[UINT_FMT] ; char *cargv[4] = { "finish", fmt0, fmt1, 0 } ; selfpipe_finish() ; + sig_restore(SIGPIPE) ; fmt0[uint_fmt(fmt0, WIFSIGNALED(status.wstat) ? 256 : WEXITSTATUS(status.wstat))] = 0 ; fmt1[uint_fmt(fmt1, WTERMSIG(status.wstat))] = 0 ; setsid() ; |