]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Fix various issues in doveconf when outputing @groups
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 19 Mar 2025 16:16:43 +0000 (18:16 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 31 Mar 2025 11:49:59 +0000 (14:49 +0300)
src/config/config-request.c
src/config/config-request.h
src/config/doveconf.c

index 2357f21f764490eeffe88095a65c1383219a5253..d5a90f3acb1774fc48ea84c160bd98add98db10b 100644 (file)
@@ -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 */
index 8d67a0de56d28d095cd918197a2895f21beb55bb..c45ac25e7c9b2086f632431b8b161e4e08778ac5 100644 (file)
@@ -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
 };
index 2f66d05b6b9541de12372f30269023d168d1c691..64ed3a9951442d6e2a5419b9cf692e8f3a9a7d84 100644 (file)
@@ -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,