process-util: add option for cloning with CLONE_NEWUSER

This is useful for allocating a userns fd later on for use in idmapped
mounts.
This commit is contained in:
Lennart Poettering
2021-05-07 22:43:42 +02:00
parent 14a25e1fae
commit 5f9687363a
2 changed files with 5 additions and 2 deletions
+1
View File
@@ -165,6 +165,7 @@ typedef enum ForkFlags {
FORK_RLIMIT_NOFILE_SAFE = 1 << 10, /* Set RLIMIT_NOFILE soft limit to 1K for select() compat */
FORK_STDOUT_TO_STDERR = 1 << 11, /* Make stdout a copy of stderr */
FORK_FLUSH_STDIO = 1 << 12, /* fflush() stdout (and stderr) before forking */
FORK_NEW_USERNS = 1 << 13, /* Run child in its own user namespace */
} ForkFlags;
int safe_fork_full(const char *name, const int except_fds[], size_t n_except_fds, ForkFlags flags, pid_t *ret_pid);