tree-wide: pass EBADF to fd params of namespace_fork()
This commit is contained in:
@@ -230,11 +230,11 @@ int machine_get_addresses(Machine *machine, struct local_address **ret_addresses
|
||||
/* except_fds = */ NULL,
|
||||
/* n_except_fds = */ 0,
|
||||
FORK_RESET_SIGNALS|FORK_DEATHSIG_SIGKILL,
|
||||
/* pidns_fd = */ -1,
|
||||
/* mntns_fd = */ -1,
|
||||
/* pidns_fd = */ -EBADF,
|
||||
/* mntns_fd = */ -EBADF,
|
||||
netns_fd,
|
||||
/* userns_fd = */ -1,
|
||||
/* root_fd = */ -1,
|
||||
/* userns_fd = */ -EBADF,
|
||||
/* root_fd = */ -EBADF,
|
||||
&child);
|
||||
if (r < 0)
|
||||
return log_debug_errno(r, "Failed to fork(): %m");
|
||||
@@ -347,8 +347,8 @@ int machine_get_os_release(Machine *machine, char ***ret_os_release) {
|
||||
FORK_RESET_SIGNALS|FORK_DEATHSIG_SIGKILL,
|
||||
pidns_fd,
|
||||
mntns_fd,
|
||||
/* netns_fd = */ -1,
|
||||
/* userns_fd = */ -1,
|
||||
/* netns_fd = */ -EBADF,
|
||||
/* userns_fd = */ -EBADF,
|
||||
root_fd,
|
||||
&child);
|
||||
if (r < 0)
|
||||
|
||||
+12
-2
@@ -1038,8 +1038,18 @@ static int mount_in_namespace_legacy(
|
||||
goto finish;
|
||||
}
|
||||
|
||||
r = namespace_fork("(sd-bindmnt)", "(sd-bindmnt-inner)", NULL, 0, FORK_RESET_SIGNALS|FORK_DEATHSIG_SIGTERM,
|
||||
pidns_fd, mntns_fd, -1, -1, root_fd, &child);
|
||||
r = namespace_fork(
|
||||
"(sd-bindmnt)",
|
||||
"(sd-bindmnt-inner)",
|
||||
/* except_fds= */ NULL,
|
||||
/* n_except_fds= */ 0,
|
||||
FORK_RESET_SIGNALS|FORK_DEATHSIG_SIGTERM,
|
||||
pidns_fd,
|
||||
mntns_fd,
|
||||
/* netns_fd= */ -EBADF,
|
||||
/* userns_fd= */ -EBADF,
|
||||
root_fd,
|
||||
&child);
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
if (r == 0) {
|
||||
|
||||
Reference in New Issue
Block a user