From: Timo Sirainen Date: Fri, 15 Dec 2023 22:07:14 +0000 (+0200) Subject: config: Enable global setting order check for named (non-list) filters X-Git-Tag: 2.4.1~1207 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f375c4f7e910aed5b5babd035fd36d76f98db042;p=thirdparty%2Fdovecot%2Fcore.git config: Enable global setting order check for named (non-list) filters The following commits change how setting overrides work for named (non-list) filters. This change avoids having silently inconsistent behavior in config file vs overrides. --- diff --git a/src/config/config-parser.c b/src/config/config-parser.c index 1088d1e3cd..26a2d4f3ed 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -1826,7 +1826,7 @@ static int config_write_value(struct config_parser_context *ctx, } static bool -config_section_has_non_named_filters(struct config_section_stack *section) +config_section_has_non_named_list_filters(struct config_section_stack *section) { struct config_filter *filter = §ion->filter_parser->filter; @@ -1836,7 +1836,8 @@ config_section_has_non_named_filters(struct config_section_stack *section) filter->local_host != NULL || filter->remote_host != NULL || filter->local_bits > 0 || - filter->remote_bits > 0) + filter->remote_bits > 0 || + (filter->filter_name != NULL && !filter->filter_name_array)) return TRUE; filter = filter->parent; @@ -1870,9 +1871,9 @@ config_parser_check_warnings(struct config_parser_context *ctx, const char *key, } if (first_pos != NULL) return; - if (!config_section_has_non_named_filters(ctx->cur_section)) { + if (!config_section_has_non_named_list_filters(ctx->cur_section)) { /* Ignore all settings inside sections containing only named - [list] filters. They aren't globals, and we don't want + list filters. They aren't globals, and we don't want warnings about overriding them if there's a same global setting later on. It just complicates configs in tests. */ return;