From: Timo Sirainen Date: Wed, 19 Mar 2025 16:16:43 +0000 (+0200) Subject: config: Fix various issues in doveconf when outputing @groups X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0f926a532262007c721e473e754b2b672ee7dfa0;p=thirdparty%2Fdovecot%2Fcore.git config: Fix various issues in doveconf when outputing @groups --- diff --git a/src/config/config-request.c b/src/config/config-request.c index 2357f21f76..d5a90f3acb 100644 --- a/src/config/config-request.c +++ b/src/config/config-request.c @@ -200,6 +200,13 @@ settings_export(struct config_export_context *ctx, } dump_default = TRUE; break; + case CONFIG_DUMP_SCOPE_SET_AND_DEFAULT_AND_GROUP_OVERRIDES: + if (change_value == 0) { + /* setting is completely unchanged */ + continue; + } + dump_default = TRUE; + break; case CONFIG_DUMP_SCOPE_CHANGED: if (change_value < CONFIG_PARSER_CHANGE_EXPLICIT) { /* setting is unchanged in config file */ diff --git a/src/config/config-request.h b/src/config/config-request.h index 8d67a0de56..c45ac25e7c 100644 --- a/src/config/config-request.h +++ b/src/config/config-request.h @@ -19,6 +19,9 @@ enum config_dump_scope { /* Same as CONFIG_DUMP_SCOPE_SET, but also dump any defaults overridden via strings (instead of the defaults struct). */ CONFIG_DUMP_SCOPE_SET_AND_DEFAULT_OVERRIDES, + /* Same as CONFIG_DUMP_SCOPE_SET_AND_DEFAULT_OVERRIDES, but also expand + group settings. */ + CONFIG_DUMP_SCOPE_SET_AND_DEFAULT_AND_GROUP_OVERRIDES, /* Dump only settings that differ from defaults */ CONFIG_DUMP_SCOPE_CHANGED }; diff --git a/src/config/doveconf.c b/src/config/doveconf.c index 2f66d05b6b..64ed3a9951 100644 --- a/src/config/doveconf.c +++ b/src/config/doveconf.c @@ -865,7 +865,7 @@ config_dump_human_filter_path(enum config_dump_scope scope, strip_prefix, strip_prefix2); bool sub_list_prefix_sent = ctx->list_prefix_sent; - if (set_name_filter == NULL) { + if (scope != CONFIG_DUMP_SCOPE_SET_AND_DEFAULT_AND_GROUP_OVERRIDES) { if (config_dump_human_include_group(filter_parser, output, sub_list_prefix_sent ? NULL : list_prefix, sub_indent)) @@ -922,8 +922,12 @@ config_dump_human(enum config_dump_scope scope, t_strsplit(setting_name_filter, "/"); if (scope == CONFIG_DUMP_SCOPE_CHANGED) scope = CONFIG_DUMP_SCOPE_SET; - else if (scope != CONFIG_DUMP_SCOPE_SET) + else if (scope == CONFIG_DUMP_SCOPE_SET) + ; + else if (setting_name_filter == NULL) scope = CONFIG_DUMP_SCOPE_SET_AND_DEFAULT_OVERRIDES; + else + scope = CONFIG_DUMP_SCOPE_SET_AND_DEFAULT_AND_GROUP_OVERRIDES; config_dump_human_filter_path(scope, set_filter_path, filter_parser->children_head, output, 0, list_prefix, &list_prefix_sent,