]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
conf-parser: drop special casing in config_parse_path()
authorLennart Poettering <lennart@poettering.net>
Mon, 3 Mar 2014 20:42:38 +0000 (21:42 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 3 Mar 2014 20:42:38 +0000 (21:42 +0100)
The code checked for two lvalues that aren't even using
config_parse_path(), so let's drop these checks and make the function
completely generic again.

src/shared/conf-parser.c

index f0bbbc39ac0a72946257d14ce039108f65147726..1ad2b4fcba85ae2f5a2db71346e41baef2eac2bc 100644 (file)
@@ -617,9 +617,7 @@ int config_parse_path(const char *unit,
                       void *data,
                       void *userdata) {
 
-        char **s = data;
-        char *n;
-        int offset;
+        char **s = data, *n;
 
         assert(filename);
         assert(lvalue);
@@ -627,16 +625,12 @@ int config_parse_path(const char *unit,
         assert(data);
 
         if (!utf8_is_valid(rvalue)) {
-                log_syntax(unit, LOG_ERR, filename, line, EINVAL,
-                           "Path is not UTF-8 clean, ignoring assignment: %s", rvalue);
+                log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Path is not UTF-8 clean, ignoring assignment: %s", rvalue);
                 return 0;
         }
 
-        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);
+        if (!path_is_absolute(rvalue)) {
+                log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Not an absolute path, ignoring: %s", rvalue);
                 return 0;
         }