summaryrefslogtreecommitdiff
path: root/src/basic/process-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-03-23 20:52:46 +0100
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commit299f585a0692b6e7a438a25a6577fc6f777659ea (patch)
treec99adda25c29d973b905b96413c9937b8d23079f /src/basic/process-util.h
parentb9e2dff07fe8b82a50b081b6032e547632e338f9 (diff)
process-util: add a new FORK_MOUNTNS_SLAVE flag for safe_fork()
We already have a flag for creating a new mount namespace for the child. Let's add an extension to that: a new FORK_MOUNTNFS_SLAVE flag. When used in combination will mark all mounts in the child namespace as MS_SLAVE so that the child can freely mount or unmount stuff but it won't leak into the parent.
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 a5f749b4e..042f24933 100644
--- a/src/basic/process-util.h
+++ b/src/basic/process-util.h
@@ -181,6 +181,7 @@ typedef enum ForkFlags {
FORK_LOG = 1U << 5,
FORK_WAIT = 1U << 6,
FORK_NEW_MOUNTNS = 1U << 7,
+ FORK_MOUNTNS_SLAVE = 1U << 8,
} ForkFlags;
int safe_fork_full(const char *name, const int except_fds[], size_t n_except_fds, ForkFlags flags, pid_t *ret_pid);