X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fexecute.c;h=066efd6fdf1c41ec0b90c51dfae13cbe212de7fd;hb=1b6d7fa742e303611dff8d7ebfa86ee5fb8b7dc7;hp=2544a2470ca772236d1520f4bbb12c7f2e7d2535;hpb=4c94096027f21d4ed0efe991534a926d39d52369;p=elogind.git diff --git a/src/core/execute.c b/src/core/execute.c index 2544a2470..066efd6fd 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -1301,7 +1301,6 @@ int exec_spawn(ExecCommand *command, int dont_close[n_fds + 3]; uid_t uid = (uid_t) -1; gid_t gid = (gid_t) -1; - sigset_t ss; int i, err; /* child */ @@ -1319,9 +1318,8 @@ int exec_spawn(ExecCommand *command, if (context->ignore_sigpipe) ignore_signals(SIGPIPE, -1); - assert_se(sigemptyset(&ss) == 0); - if (sigprocmask(SIG_SETMASK, &ss, NULL) < 0) { - err = -errno; + err = reset_signal_mask(); + if (err < 0) { r = EXIT_SIGNAL_MASK; goto fail_child; } @@ -1635,7 +1633,9 @@ int exec_spawn(ExecCommand *command, } /* We repeat the fd closing here, to make sure that - * nothing is leaked from the PAM modules */ + * nothing is leaked from the PAM modules. Note that + * we are more aggressive this time since socket_fd + * and the netns fds we don#t need anymore. */ err = close_all_fds(fds, n_fds); if (err >= 0) err = shift_fds(fds, n_fds);