conf-parser: restrict .include usage

Disallow recursive .include, and make it unavailable in anything but
unit files.
This commit is contained in:
Lennart Poettering
2013-04-25 00:05:14 -03:00
parent 60b6991a4d
commit db5c012285
11 changed files with 26 additions and 24 deletions
+1 -1
View File
@@ -200,7 +200,7 @@ int unit_load_dropin(Unit *u) {
STRV_FOREACH(f, u->dropin_paths) {
r = config_parse(u->id, *f, NULL,
UNIT_VTABLE(u)->sections, config_item_perf_lookup,
(void*) load_fragment_gperf_lookup, false, u);
(void*) load_fragment_gperf_lookup, false, false, u);
if (r < 0)
return r;
}
+1 -1
View File
@@ -2270,7 +2270,7 @@ static int load_from_path(Unit *u, const char *path) {
/* Now, parse the file contents */
r = config_parse(u->id, filename, f, UNIT_VTABLE(u)->sections,
config_item_perf_lookup,
(void*) load_fragment_gperf_lookup, false, u);
(void*) load_fragment_gperf_lookup, false, true, u);
if (r < 0)
goto finish;
+1 -1
View File
@@ -677,7 +677,7 @@ static int parse_config_file(void) {
return 0;
}
r = config_parse(NULL, fn, f, "Manager\0", config_item_table_lookup, (void*) items, false, NULL);
r = config_parse(NULL, fn, f, "Manager\0", config_item_table_lookup, (void*) items, false, false, NULL);
if (r < 0)
log_warning("Failed to parse configuration file: %s", strerror(-r));