summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-26 01:43:23 +0100
committerLennart Poettering <lennart@poettering.net>2015-10-26 01:43:23 +0100
commite05ac0557f10536c213bf93a3e23e1c82de288bb (patch)
treeeb5d5ee062881d11daa5f2638a5ba925ea60501e /src/core
parentae9b44b64c8494f2cec4198ce9034c53f48ce699 (diff)
parent64fa5643df3353260720e7ca7cb484b1f364dbeb (diff)
Merge pull request #1675 from evverx/run-protect-home
systemd-run can launch units with ProtectHome
Diffstat (limited to 'src/core')
-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 af352531a4..6f1e0dc6ac 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -1361,6 +1361,32 @@ int bus_exec_context_set_transient_property(
return 1;
+ } else if (streq(name, "ProtectHome")) {
+ const char *s;
+ ProtectHome ph;
+
+ r = sd_bus_message_read(message, "s", &s);
+ if (r < 0)
+ return r;
+
+ r = parse_boolean(s);
+ if (r > 0)
+ ph = PROTECT_HOME_YES;
+ else if (r == 0)
+ ph = PROTECT_HOME_NO;
+ else {
+ ph = protect_home_from_string(s);
+ if (ph < 0)
+ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Failed to parse protect home value");
+ }
+
+ if (mode != UNIT_CHECK) {
+ c->protect_home = ph;
+ 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;