From b26ab4d08caeb487208271ac6f51c6e3f1c5e5e6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 13 Jan 2017 12:02:46 +0100 Subject: config: do not resolve default profile during "include" processing Application of options in the default section is "delayed" until the whole config file is read in order to allow profile forward references. This was run at the end of parsing a config file - but because of "include" options, this means it's not always called at the end of the main config file. Use the recursion counter to prevent it from being processed after each "include" option. This also gets rid of the resulting unintended infinite recursion (which eventually stopped and failed loading the config file) due to m_config_finish_default_profile() processing the "include" option again. Fixes #4024. --- options/parse_configfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'options') diff --git a/options/parse_configfile.c b/options/parse_configfile.c index e7c877349d..0ef80082d4 100644 --- a/options/parse_configfile.c +++ b/options/parse_configfile.c @@ -150,7 +150,8 @@ int m_config_parse(m_config_t *config, const char *location, bstr data, } } - m_config_finish_default_profile(config, flags); + if (config->recursion_depth == 0) + m_config_finish_default_profile(config, flags); talloc_free(tmp); return 1; -- cgit v1.2.3