core: add namespace_fork() helper, that forks, joins a set of namespaces and forks again
This helper is useful to ensure pidns/userns joining is properly executed (as that requires a fork after the setns()). This is particularly important when it comes to /proc/self/ access or SCM_CREDENTIALS, but is generally the safer mode of operation.
This commit is contained in:
@@ -159,6 +159,8 @@ static inline int safe_fork(const char *name, ForkFlags flags, pid_t *ret_pid) {
|
||||
return safe_fork_full(name, NULL, 0, flags, ret_pid);
|
||||
}
|
||||
|
||||
int namespace_fork(const char *outer_name, const char *inner_name, const int except_fds[], size_t n_except_fds, ForkFlags flags, int pidns_fd, int mntns_fd, int netns_fd, int userns_fd, int root_fd, pid_t *ret_pid);
|
||||
|
||||
int fork_agent(const char *name, const int except[], size_t n_except, pid_t *pid, const char *path, ...) _sentinel_;
|
||||
|
||||
int set_oom_score_adjust(int value);
|
||||
|
||||
Reference in New Issue
Block a user