]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Fix expanding $SET:key inside filters.
authorsergey.kitov <sergey.kitov@open-xchange.com>
Thu, 15 May 2025 08:58:48 +0000 (11:58 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 19 May 2025 08:06:55 +0000 (08:06 +0000)
expand_parent parameter was added to config_get_value() in
92a9ff5e799adf9bffb8831576d84eb84b8ef09a, so its behavior was likely
useful only in the earlier hierarchical configuration.

src/config/config-parser.c

index 0ae5e46ddbb22eb06f4ff94a5e241057fd0b6081..e8f3ffec17e25150b5e0766df62e3e1b0de1e88c 100644 (file)
@@ -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 =
                &section->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",