mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 00:51:24 +03:00
core: always initialize ExecParamters.bus_endpoint_fd to -1
Otherwise it might be passed in as 0, which is a valid fd, but usually does not refer to a real endpoint.
This commit is contained in:
parent
d3650f0c4b
commit
6f856a0992
@ -694,6 +694,7 @@ static int mount_spawn(Mount *m, ExecCommand *c, pid_t *_pid) {
|
|||||||
.apply_permissions = true,
|
.apply_permissions = true,
|
||||||
.apply_chroot = true,
|
.apply_chroot = true,
|
||||||
.apply_tty_stdin = true,
|
.apply_tty_stdin = true,
|
||||||
|
.bus_endpoint_fd = -1,
|
||||||
};
|
};
|
||||||
|
|
||||||
assert(m);
|
assert(m);
|
||||||
|
@ -1054,10 +1054,10 @@ static int service_spawn(
|
|||||||
**argv = NULL, **final_env = NULL, **our_env = NULL;
|
**argv = NULL, **final_env = NULL, **our_env = NULL;
|
||||||
const char *path;
|
const char *path;
|
||||||
ExecParameters exec_params = {
|
ExecParameters exec_params = {
|
||||||
.apply_permissions = apply_permissions,
|
.apply_permissions = apply_permissions,
|
||||||
.apply_chroot = apply_chroot,
|
.apply_chroot = apply_chroot,
|
||||||
.apply_tty_stdin = apply_tty_stdin,
|
.apply_tty_stdin = apply_tty_stdin,
|
||||||
.bus_endpoint_fd = -1,
|
.bus_endpoint_fd = -1,
|
||||||
.selinux_context_net = s->socket_fd_selinux_context_net
|
.selinux_context_net = s->socket_fd_selinux_context_net
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1398,6 +1398,7 @@ static int socket_spawn(Socket *s, ExecCommand *c, pid_t *_pid) {
|
|||||||
.apply_permissions = true,
|
.apply_permissions = true,
|
||||||
.apply_chroot = true,
|
.apply_chroot = true,
|
||||||
.apply_tty_stdin = true,
|
.apply_tty_stdin = true,
|
||||||
|
.bus_endpoint_fd = -1,
|
||||||
};
|
};
|
||||||
|
|
||||||
assert(s);
|
assert(s);
|
||||||
|
@ -607,6 +607,7 @@ static int swap_spawn(Swap *s, ExecCommand *c, pid_t *_pid) {
|
|||||||
.apply_permissions = true,
|
.apply_permissions = true,
|
||||||
.apply_chroot = true,
|
.apply_chroot = true,
|
||||||
.apply_tty_stdin = true,
|
.apply_tty_stdin = true,
|
||||||
|
.bus_endpoint_fd = -1,
|
||||||
};
|
};
|
||||||
|
|
||||||
assert(s);
|
assert(s);
|
||||||
|
Loading…
Reference in New Issue
Block a user