From e73060ad593975f4477f07cd44e4c26601e4bfe5 Mon Sep 17 00:00:00 2001 From: Ryan S <3932619+TheWug@users.noreply.github.com> Date: Fri, 3 Aug 2018 08:51:07 -0700 Subject: [PATCH] Unblock signals when spawning child processes. The signal mask is inherited by children, so if we don't remove it the shell module spawns processes which are accidentally resistant to most signals. see: man sigprocmask (znc uses pthread_sigmask, but they act the same) --- src/FileUtils.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/FileUtils.cpp b/src/FileUtils.cpp index 1ac172ba..784d81ae 100644 --- a/src/FileUtils.cpp +++ b/src/FileUtils.cpp @@ -645,6 +645,9 @@ int CExecSock::popen2(int& iReadFD, int& iWriteFD, const CString& sCommand) { } if (iPid == 0) { + sigset_t signals; + sigemptyset(&signals); + sigprocmask(SIG_SETMASK, &signals, nullptr); close(wpipes[1]); close(rpipes[0]); dup2(wpipes[0], 0);