]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: always initialize ExecParamters.bus_endpoint_fd to -1
authorLennart Poettering <lennart@poettering.net>
Mon, 11 May 2015 18:13:37 +0000 (20:13 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 11 May 2015 20:18:21 +0000 (22:18 +0200)
Otherwise it might be passed in as 0, which is a valid fd, but usually
does not refer to a real endpoint.

src/core/mount.c
src/core/service.c
src/core/socket.c
src/core/swap.c

index 65a66b468ff4c9a5382d966c07fc61ecdfac4892..5a1547728b29d25aa8d6312622a5fddc31083c4a 100644 (file)
@@ -694,6 +694,7 @@ static int mount_spawn(Mount *m, ExecCommand *c, pid_t *_pid) {
                 .apply_permissions = true,
                 .apply_chroot      = true,
                 .apply_tty_stdin   = true,
+                .bus_endpoint_fd   = -1,
         };
 
         assert(m);
index d52ba73aac9766300a47affb446aae320c8909ee..1c55e53c3c681a71350268a84e7bfe6273c8a9c5 100644 (file)
@@ -1054,10 +1054,10 @@ static int service_spawn(
                 **argv = NULL, **final_env = NULL, **our_env = NULL;
         const char *path;
         ExecParameters exec_params = {
-                .apply_permissions = apply_permissions,
-                .apply_chroot      = apply_chroot,
-                .apply_tty_stdin   = apply_tty_stdin,
-                .bus_endpoint_fd   = -1,
+                .apply_permissions   = apply_permissions,
+                .apply_chroot        = apply_chroot,
+                .apply_tty_stdin     = apply_tty_stdin,
+                .bus_endpoint_fd     = -1,
                 .selinux_context_net = s->socket_fd_selinux_context_net
         };
 
index 55334e4a54d53a3457222be5587492cf12c44a74..3fb3b362e1ba57cdb617fb837a69946e46e925cf 100644 (file)
@@ -1398,6 +1398,7 @@ static int socket_spawn(Socket *s, ExecCommand *c, pid_t *_pid) {
                 .apply_permissions = true,
                 .apply_chroot      = true,
                 .apply_tty_stdin   = true,
+                .bus_endpoint_fd   = -1,
         };
 
         assert(s);
index 5f98f0b98bedd54b59414f1c6b91f2169043c3cd..0d04bb4de816ecddb305669328f54500edf0c17f 100644 (file)
@@ -607,6 +607,7 @@ static int swap_spawn(Swap *s, ExecCommand *c, pid_t *_pid) {
                 .apply_permissions = true,
                 .apply_chroot      = true,
                 .apply_tty_stdin   = true,
+                .bus_endpoint_fd   = -1,
         };
 
         assert(s);