summaryrefslogtreecommitdiff
path: root/src/core/dbus-manager.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-11-12 18:18:45 +0100
committerDaniel Mack <github@zonque.org>2015-11-12 18:18:45 +0100
commitf1637bd3a81fe0468b53d7aa91b44cc0c34410d7 (patch)
tree60306026034427f5016a1da67cdb9d4689e2a5e9 /src/core/dbus-manager.c
parent05c450966a08ff85fa8348e2fe41b722612fa3dc (diff)
parent79413b673b45adc98dfeaec882bbdda2343cb2f9 (diff)
Merge pull request #1515 from poettering/install-symlink
install: follow unit file symlinks in /usr, but not /etc when looking for [Install] data and more
Diffstat (limited to 'src/core/dbus-manager.c')
-rw-r--r--src/core/dbus-manager.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index eaa0fb2b37..d3bcc795ae 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -1521,9 +1521,9 @@ static int method_get_unit_file_state(sd_bus_message *message, void *userdata, s
scope = m->running_as == MANAGER_SYSTEM ? UNIT_FILE_SYSTEM : UNIT_FILE_USER;
- state = unit_file_get_state(scope, NULL, name);
- if (state < 0)
- return state;
+ r = unit_file_get_state(scope, NULL, name, &state);
+ if (r < 0)
+ return r;
return sd_bus_reply_method_return(message, "s", unit_file_state_to_string(state));
}
@@ -1651,6 +1651,8 @@ static int method_enable_unit_files_generic(
scope = m->running_as == MANAGER_SYSTEM ? UNIT_FILE_SYSTEM : UNIT_FILE_USER;
r = call(scope, runtime, NULL, l, force, &changes, &n_changes);
+ if (r == -ESHUTDOWN)
+ return sd_bus_error_setf(error, BUS_ERROR_UNIT_MASKED, "Unit file is masked");
if (r < 0)
return r;
@@ -1885,6 +1887,8 @@ static int method_add_dependency_unit_files(sd_bus_message *message, void *userd
scope = m->running_as == MANAGER_SYSTEM ? UNIT_FILE_SYSTEM : UNIT_FILE_USER;
r = unit_file_add_dependency(scope, runtime, NULL, l, target, dep, force, &changes, &n_changes);
+ if (r == -ESHUTDOWN)
+ return sd_bus_error_setf(error, BUS_ERROR_UNIT_MASKED, "Unit file is masked");
if (r < 0)
return r;