From f6f13c914fe9ec2849dd360d96ff44571b37ab81 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 15 Sep 2009 15:40:47 +0200 Subject: [PATCH] exec plugin: Clear the signal block mask before calling exec(2). --- src/exec.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/exec.c b/src/exec.c index 1f8a9ac0..8719201e 100644 --- a/src/exec.c +++ b/src/exec.c @@ -382,6 +382,15 @@ static void exec_child (program_list_t *pl) /* {{{ */ exit (-1); } /* void exec_child }}} */ +static void reset_signal_mask (void) /* {{{ */ +{ + sigset_t ss; + + memset (&ss, 0, sizeof (ss)); + sigemptyset (&ss); + sigprocmask (SIG_SETMASK, &ss, /* old mask = */ NULL); +} /* }}} void reset_signal_mask */ + /* * Creates three pipes (one for reading, one for writing and one for errors), * forks a child, sets up the pipes so that fd_in is connected to STDIN of @@ -468,6 +477,9 @@ static int fork_child (program_list_t *pl, int *fd_in, int *fd_out, int *fd_err) close (fd_pipe_err[1]); } + /* Unblock all signals */ + reset_signal_mask (); + exec_child (pl); /* does not return */ } -- 2.30.2