summaryrefslogtreecommitdiff
path: root/execute.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-27 06:17:51 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-27 06:17:51 +0100
commit309bff19edec5e5a5f6c66ead3b0aa1eb55e7bc7 (patch)
tree31e10083bd7c618c23c92c12ecd8f069d8d97e91 /execute.c
parente9af15c34c05ec1d79766911b722b6ab91d0c79d (diff)
reset signal mask when forking
Diffstat (limited to 'execute.c')
-rw-r--r--execute.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/execute.c b/execute.c
index 5def5ce1af..6b1d4a1da1 100644
--- a/execute.c
+++ b/execute.c
@@ -6,6 +6,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
+#include <signal.h>
#include "execute.h"
#include "strv.h"
@@ -121,8 +122,16 @@ int exec_spawn(const ExecCommand *command, const ExecContext *context, int *fds,
char **e, **f = NULL;
int i, r;
char t[16];
+ sigset_t ss;
+
/* child */
+ if (sigemptyset(&ss) < 0 ||
+ sigprocmask(SIG_SETMASK, &ss, NULL) < 0) {
+ r = EXIT_SIGNAL_MASK;
+ goto fail;
+ }
+
umask(context->umask);
if (chdir(context->directory ? context->directory : "/") < 0) {