process-util: make safe_fork() unset $NOTIFY_SOCKET

Propagating $NOTIFY_SOCKET is typically dangerous. Let's unset it unless
explicitly requested to keep it.

Fixes #27288.
Replaces #27291.
This commit is contained in:
Yu Watanabe
2023-04-17 05:46:32 +08:00
committed by Mike Yuan
parent 4518126807
commit 2cd04086ee
5 changed files with 9 additions and 4 deletions
-2
View File
@@ -706,8 +706,6 @@ static int worker_main(Manager *_manager, sd_device_monitor *monitor, sd_device
assert(monitor);
assert(dev);
assert_se(unsetenv("NOTIFY_SOCKET") == 0);
assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGTERM, -1) >= 0);
/* Reset OOM score, we only protect the main daemon. */