conf-parser: restrict .include usage
Disallow recursive .include, and make it unavailable in anything but unit files.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user