From b0830e21f47109d8a6ba2fc0afbf9b2ca1ffc2a9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 22 Oct 2015 02:02:17 +0200 Subject: [PATCH] core: check parsed bus msg in full before applying it --- src/core/dbus-execute.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index 6712b86232d..b8da66c9858 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -1173,7 +1173,6 @@ int bus_exec_context_set_transient_property( unit_write_drop_in_private_format(u, mode, name, "Environment=%s\n", joined); } - } return 1; @@ -1262,6 +1261,10 @@ int bus_exec_context_set_transient_property( if (r < 0) return r; + r = sd_bus_message_exit_container(message); + if (r < 0) + return r; + r = fflush_and_check(f); if (r < 0) return r; @@ -1279,10 +1282,6 @@ int bus_exec_context_set_transient_property( } } - r = sd_bus_message_exit_container(message); - if (r < 0) - return r; - return 1; } else if (STR_IN_SET(name, "ReadWriteDirectories", "ReadOnlyDirectories", "InaccessibleDirectories")) {