diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-11-22 20:19:08 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-12-13 21:22:13 +0100 |
commit | 835552511ef5edec94b567441251ada2a37ea333 (patch) | |
tree | 120f0cd18708151cbdfe34e74792e6d24c3da42e /src/shared | |
parent | 9ef4e1e5a2d0a9cc50406f1cae05f3918d6f0c2a (diff) |
core: hook up MountFlags= to the transient unit logic
This makes "systemd-run -p MountFlags=shared -t /bin/sh" work, by making
MountFlags= to the list of properties that may be accessed transiently.
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/bus-unit-util.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 3114275c85..6dd9f2ccd4 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -27,6 +27,7 @@ #include "hashmap.h" #include "list.h" #include "locale-util.h" +#include "mount-util.h" #include "nsflags.h" #include "parse-util.h" #include "path-util.h" @@ -575,7 +576,21 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen r = sd_bus_message_append(m, "v", "t", flags); } else if ((dep = unit_dependency_from_string(field)) >= 0) r = sd_bus_message_append(m, "v", "as", 1, eq); - else { + else if (streq(field, "MountFlags")) { + unsigned long f; + + if (isempty(eq)) + f = 0; + else { + f = mount_propagation_flags_from_string(eq); + if (f == 0) { + log_error("Failed to parse mount propagation type: %s", eq); + return -EINVAL; + } + } + + r = sd_bus_message_append(m, "v", "t", f); + } else { log_error("Unknown assignment %s.", assignment); return -EINVAL; } |