summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorMaciej Wereski <m.wereski@partner.samsung.com>2013-08-21 16:43:55 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-08-23 12:48:14 -0400
commitea92ae33e0fbbf8a98cd2e08ca5a850d83d57fae (patch)
tree9a4285fc26e58f99c41d8d7bed8e60732ff4227c /src/shared
parentac8e20c6e95975316279740778f381ad50a1a21a (diff)
"-" prefix for InaccessibleDirectories and ReadOnlyDirectories
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/conf-parser.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index 2303d9a50b..6085d33391 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -599,6 +599,7 @@ int config_parse_path(const char *unit,
char **s = data;
char *n;
+ int offset;
assert(filename);
assert(lvalue);
@@ -611,7 +612,9 @@ int config_parse_path(const char *unit,
return 0;
}
- if (!path_is_absolute(rvalue)) {
+ offset = rvalue[0] == '-' && (streq(lvalue, "InaccessibleDirectories") ||
+ streq(lvalue, "ReadOnlyDirectories"));
+ if (!path_is_absolute(rvalue + offset)) {
log_syntax(unit, LOG_ERR, filename, line, EINVAL,
"Not an absolute path, ignoring: %s", rvalue);
return 0;
@@ -713,6 +716,7 @@ int config_parse_path_strv(const char *unit,
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
_cleanup_free_ char *n;
+ int offset;
n = strndup(w, l);
if (!n)
@@ -724,7 +728,9 @@ int config_parse_path_strv(const char *unit,
continue;
}
- if (!path_is_absolute(n)) {
+ offset = n[0] == '-' && (streq(lvalue, "InaccessibleDirectories") ||
+ streq(lvalue, "ReadOnlyDirectories"));
+ if (!path_is_absolute(n + offset)) {
log_syntax(unit, LOG_ERR, filename, line, EINVAL,
"Not an absolute path, ignoring: %s", rvalue);
continue;