From: Gunnar Beutner Date: Tue, 22 Nov 2016 12:45:59 +0000 (+0100) Subject: Properly unmask signals for child processes X-Git-Tag: v2.6.0~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78fa197b9f22ece1824bd6f8f429070833c01d5c;p=icinga2 Properly unmask signals for child processes fixes #13269 --- diff --git a/lib/base/process.cpp b/lib/base/process.cpp index 34504247b..e1e687ced 100644 --- a/lib/base/process.cpp +++ b/lib/base/process.cpp @@ -165,6 +165,10 @@ static Value ProcessSpawnImpl(struct msghdr *msgh, const Dictionary::Ptr& reques Log(LogWarning, "base", "Failed to renice child process."); #endif /* HAVE_NICE */ + sigset_t mask; + sigemptyset(&mask); + sigprocmask(SIG_SETMASK, &mask, NULL); + if (icinga2_execvpe(argv[0], argv, envp) < 0) { char errmsg[512]; strcpy(errmsg, "execvpe("); @@ -228,6 +232,10 @@ static Value ProcessWaitPIDImpl(struct msghdr *msgh, const Dictionary::Ptr& requ static void ProcessHandler(void) { + sigset_t mask; + sigfillset(&mask); + sigprocmask(SIG_SETMASK, &mask, NULL); + rlimit rl; if (getrlimit(RLIMIT_NOFILE, &rl) >= 0) { rlim_t maxfds = rl.rlim_max;