summaryrefslogtreecommitdiff
path: root/src/basic/process-util.h
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-04-17 02:09:38 +0900
committerMike Yuan <me@yhndnzj.com>2023-04-17 05:46:32 +0800
commit2cd04086ee555ae9b1423f6a4c5adeffd2affd72 (patch)
tree3957c0bdcdc79f638b221994042663269505fd03 /src/basic/process-util.h
parent451812680755bdf62512bc3c174278280d5ce9cb (diff)
downloadsystemd-2cd04086ee555ae9b1423f6a4c5adeffd2affd72.tar.gz
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.
Diffstat (limited to 'src/basic/process-util.h')
-rw-r--r--src/basic/process-util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/process-util.h b/src/basic/process-util.h
index 5188f3c605..230a0edb09 100644
--- a/src/basic/process-util.h
+++ b/src/basic/process-util.h
@@ -156,6 +156,7 @@ typedef enum ForkFlags {
FORK_FLUSH_STDIO = 1 << 13, /* fflush() stdout (and stderr) before forking */
FORK_NEW_USERNS = 1 << 14, /* Run child in its own user namespace */
FORK_CLOEXEC_OFF = 1 << 15, /* In the child: turn off O_CLOEXEC on all fds in except_fds[] */
+ FORK_KEEP_NOTIFY_SOCKET = 1 << 16, /* Unless this specified, $NOTIFY_SOCKET will be unset. */
} ForkFlags;
int safe_fork_full(