From 922e978f56ed8a00700ed7730ea56bd1e10665b3 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 6 Oct 2022 19:02:03 +0100 Subject: [PATCH] reset sigmask on fork --- src/config/ConfigManager.cpp | 5 +++++ src/managers/KeybindManager.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index c1ea3e01..da954cf9 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -379,6 +379,11 @@ void CConfigManager::handleRawExec(const std::string& command, const std::string if (child == 0) { // run in child grandchild = fork(); + + sigset_t set; + sigemptyset(&set); + sigprocmask(SIG_SETMASK, &set, NULL); + if (grandchild == 0) { // run in grandchild close(socket[0]); diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index d61bf7fd..3e00ea09 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -500,6 +500,11 @@ void CKeybindManager::spawn(std::string args) { } if (child == 0) { // run in child + + sigset_t set; + sigemptyset(&set); + sigprocmask(SIG_SETMASK, &set, NULL); + grandchild = fork(); if (grandchild == 0) { // run in grandchild