diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-12-23 01:16:43 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-02-07 11:22:05 +0100 |
commit | 20b7a0070c2f5a31442f59bece47f7f0875da3cd (patch) | |
tree | 08bd087478f310adf24e94b34a21b135da0aaf26 /src/core/dbus-execute.c | |
parent | 5d997827e2ebe5d4f438748d1ac87c10c29045c6 (diff) |
core: actually make "+" prefix in ReadOnlyPaths=, InaccessiblePaths=, ReadWritablePaths= work
5327c910d2fc1ae91bd0b891be92b30379c7467b claimed to add support for "+"
for prefixing paths with the configured RootDirectory=. But actually it
only implemented it in the backend, it did not add support for it to the
configuration file parsers. Fix that now.
Diffstat (limited to 'src/core/dbus-execute.c')
-rw-r--r-- | src/core/dbus-execute.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index 60b0288bb0..c57af5aaaf 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -1498,12 +1498,15 @@ int bus_exec_context_set_transient_property( return r; STRV_FOREACH(p, l) { - int offset; - if (!utf8_is_valid(*p)) + const char *i = *p; + size_t offset; + + if (!utf8_is_valid(i)) return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid %s", name); - offset = **p == '-'; - if (!path_is_absolute(*p + offset)) + offset = i[0] == '-'; + offset += i[offset] == '+'; + if (!path_is_absolute(i + offset)) return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid %s", name); } @@ -1522,7 +1525,6 @@ int bus_exec_context_set_transient_property( unit_write_drop_in_private_format(u, mode, name, "%s=", name); } else { r = strv_extend_strv(dirs, l, true); - if (r < 0) return -ENOMEM; |