summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2015-10-27 04:56:42 +0300
committerEvgeny Vereshchagin <evvers@ya.ru>2015-10-27 05:18:06 +0300
commitfa21b5e3d763412226beefba8443011581be79eb (patch)
tree142d519d2c44b50507f61fc30d61f6fdb4b6c73b /src/shared
parenta9067193dd883289570b05ff2c9f0c3def302a39 (diff)
run: can launch units with RuntimeDirectory
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/bus-util.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 604b8f248a..e6c5875766 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -1781,6 +1781,40 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
r = sd_bus_message_close_container(m);
+ } else if (streq(field, "RuntimeDirectory")) {
+ const char *p;
+
+ r = sd_bus_message_open_container(m, 'v', "as");
+ if (r < 0)
+ return bus_log_create_error(r);
+
+ r = sd_bus_message_open_container(m, 'a', "s");
+ if (r < 0)
+ return bus_log_create_error(r);
+
+ p = eq;
+
+ for (;;) {
+ _cleanup_free_ char *word = NULL;
+
+ r = extract_first_word(&p, &word, NULL, EXTRACT_QUOTES);
+ if (r < 0)
+ return log_error_errno(r, "Failed to parse %s value %s", field, eq);
+
+ if (r == 0)
+ break;
+
+ r = sd_bus_message_append_basic(m, 's', word);
+ if (r < 0)
+ return bus_log_create_error(r);
+ }
+
+ r = sd_bus_message_close_container(m);
+ if (r < 0)
+ return bus_log_create_error(r);
+
+ r = sd_bus_message_close_container(m);
+
} else {
log_error("Unknown assignment %s.", assignment);
return -EINVAL;