summaryrefslogtreecommitdiff
path: root/src/shared/conf-parser.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-03-03 21:40:55 +0100
committerLennart Poettering <lennart@poettering.net>2014-03-03 21:40:55 +0100
commit94828d2ddc89c9dba3d6f386e55b6c9310d8f627 (patch)
tree272b57a979a9c46e2f21c8f9ca4034526e8852a7 /src/shared/conf-parser.c
parent3af00fb85a26a1d812363fbf88c045311fd05376 (diff)
conf-parser: config_parse_path_strv() is not generic, so let's move it into load-fragment.c
The parse code actually checked for specific lvalue names, which is really wrong for supposedly generic parsers...
Diffstat (limited to 'src/shared/conf-parser.c')
-rw-r--r--src/shared/conf-parser.c58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index 161f6ad65a..f0bbbc39ac 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -709,64 +709,6 @@ int config_parse_strv(const char *unit,
return 0;
}
-int config_parse_path_strv(const char *unit,
- const char *filename,
- unsigned line,
- const char *section,
- unsigned section_line,
- const char *lvalue,
- int ltype,
- const char *rvalue,
- void *data,
- void *userdata) {
-
- char*** sv = data, *w, *state;
- size_t l;
- int r;
-
- assert(filename);
- assert(lvalue);
- assert(rvalue);
- assert(data);
-
- if (isempty(rvalue)) {
- /* Empty assignment resets the list */
- strv_free(*sv);
- *sv = NULL;
- return 0;
- }
-
- FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- _cleanup_free_ char *n;
- int offset;
-
- n = strndup(w, l);
- if (!n)
- return log_oom();
-
- if (!utf8_is_valid(n)) {
- log_syntax(unit, LOG_ERR, filename, line, EINVAL,
- "Path is not UTF-8 clean, ignoring assignment: %s", rvalue);
- continue;
- }
-
- 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;
- }
-
- path_kill_slashes(n);
- r = strv_extend(sv, n);
- if (r < 0)
- return log_oom();
- }
-
- return 0;
-}
-
int config_parse_mode(const char *unit,
const char *filename,
unsigned line,