From: sergey.kitov Date: Thu, 15 May 2025 08:58:48 +0000 (+0300) Subject: config: Fix expanding $SET:key inside filters. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4085debd3e553ed57b95feaed6c4aafaac8026f8;p=thirdparty%2Fdovecot%2Fcore.git config: Fix expanding $SET:key inside filters. expand_parent parameter was added to config_get_value() in 92a9ff5e799adf9bffb8831576d84eb84b8ef09a, so its behavior was likely useful only in the earlier hierarchical configuration. --- diff --git a/src/config/config-parser.c b/src/config/config-parser.c index 0ae5e46ddb..e8f3ffec17 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -2406,8 +2406,8 @@ config_parse_finish(struct config_parser_context *ctx, static bool config_get_value(struct config_section_stack *section, - struct config_parser_key *config_key, const char *key, - bool expand_parent, string_t *str) + struct config_parser_key *config_key, + const char *key, string_t *str) { struct config_module_parser *l = §ion->filter_parser->module_parsers[config_key->info_idx]; @@ -2422,7 +2422,7 @@ config_get_value(struct config_section_stack *section, str_append(str, l->settings[config_key->define_idx].str); return TRUE; } - if (!expand_parent || section->prev == NULL) { + if (section->prev == NULL) { /* use the default setting */ const void *value = CONST_PTR_OFFSET(l->info->defaults, def->offset); @@ -2432,7 +2432,7 @@ config_get_value(struct config_section_stack *section, } /* not changed by this parser. maybe parent has. */ - return config_get_value(section->prev, config_key, key, TRUE, str); + return config_get_value(section->prev, config_key, key, str); } static int config_write_keyvariable(struct config_parser_context *ctx, @@ -2473,7 +2473,7 @@ static int config_write_keyvariable(struct config_parser_context *ctx, return -1; } if (!config_get_value(ctx->cur_section, config_key, - set_name, expand_parent, str)) { + set_name, str)) { ctx->error = p_strdup_printf(ctx->pool, "Failed to expand $SET:%s: " "Setting type can't be expanded to string",