From c0e09dfe5ff3630f914f1008941a1cfdacbd3db2 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 11 Feb 2021 17:38:53 +0000 Subject: bugfix: unignore SIGPIPE before execing a user-controlled process --- src/supervision/s6-supervise.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/supervision/s6-supervise.c') 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() ; -- cgit v1.2.3