summaryrefslogtreecommitdiff
path: root/src/core/dbus-execute.c
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2015-10-24 22:48:33 +0000
committerEvgeny Vereshchagin <evvers@ya.ru>2015-10-24 22:48:33 +0000
commit5664e6cf463920a3365a891f07bad98207ff5aab (patch)
tree33b930af97bf88bd61ffcb204f785fe317b45e06 /src/core/dbus-execute.c
parent0c0f1bc8f76dadb6ccaf89e8df778188503a56cf (diff)
run: can launch units with ProtectSystem
Diffstat (limited to 'src/core/dbus-execute.c')
-rw-r--r--src/core/dbus-execute.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index b8da66c985..47531e2354 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -1334,6 +1334,32 @@ int bus_exec_context_set_transient_property(
return 1;
+ } else if (streq(name, "ProtectSystem")) {
+ const char *s;
+ ProtectSystem ps;
+
+ r = sd_bus_message_read(message, "s", &s);
+ if (r < 0)
+ return r;
+
+ r = parse_boolean(s);
+ if (r > 0)
+ ps = PROTECT_SYSTEM_YES;
+ else if (r == 0)
+ ps = PROTECT_SYSTEM_NO;
+ else {
+ ps = protect_system_from_string(s);
+ if (ps < 0)
+ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Failed to parse protect system value");
+ }
+
+ if (mode != UNIT_CHECK) {
+ c->protect_system = ps;
+ unit_write_drop_in_private_format(u, mode, name, "%s=%s\n", name, s);
+ }
+
+ return 1;
+
} else if (rlimit_from_string(name) >= 0) {
uint64_t rl;
rlim_t x;