summaryrefslogtreecommitdiff
path: root/src/shared
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
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')
-rw-r--r--src/shared/conf-parser.c58
-rw-r--r--src/shared/conf-parser.h1
2 files changed, 0 insertions, 59 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,
diff --git a/src/shared/conf-parser.h b/src/shared/conf-parser.h
index b7f442926f..e1c7ab44c9 100644
--- a/src/shared/conf-parser.h
+++ b/src/shared/conf-parser.h
@@ -104,7 +104,6 @@ int config_parse_bool(const char *unit, const char *filename, unsigned line, con
int config_parse_string(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);
int config_parse_path(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);
int config_parse_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);
-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);
int config_parse_sec(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);
int config_parse_nsec(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);
int config_parse_mode(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);