Skip to content

Commit 2535eef

Browse files
happyCoder92copybara-github
authored andcommitted
Reset signal handler for SIGTERM in sandboxee
Global forkserver explicitly sets SIGTERM to SIG_IGN PiperOrigin-RevId: 781080552 Change-Id: I1790205ae266fdb6894acc1991cb77a70a60b4c7
1 parent 394d5cf commit 2535eef

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

sandboxed_api/sandbox2/forkserver.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ void ForkServer::LaunchChild(const ForkRequest& request, int execve_fd,
297297
SAPI_RAW_CHECK(request.mode() != FORKSERVER_FORK_UNSPECIFIED,
298298
"Forkserver mode is unspecified");
299299

300+
// Restore the default handler for SIGTERM.
301+
if (signal(SIGTERM, SIG_DFL) == SIG_ERR) {
302+
SAPI_RAW_PLOG(WARNING, "signal(SIGTERM, SIG_DFL)");
303+
}
304+
300305
const bool will_execve = execve_fd != -1;
301306
const bool should_sandbox = request.mode() == FORKSERVER_FORK_EXECVE_SANDBOX;
302307

0 commit comments

Comments
 (0)