From: Timo Sirainen Date: Tue, 29 Jul 2025 17:10:03 +0000 (+0300) Subject: config: Setting changes may have updated the included group's settings X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e8c1c1c94f0c8fe048df99ad97c213109f123ed;p=thirdparty%2Fdovecot%2Fcore.git config: Setting changes may have updated the included group's settings If group include was done before other settings, any further updates changed the group's settings. For example: group @test foo { default_internal_user = A } service imap { @test = foo default_internal_user = B } service pop3 { @test = foo } This caused service pop3 to also have default_internal_user=B. --- diff --git a/src/config/config-parser.c b/src/config/config-parser.c index 2a8bbbc888..c860baf930 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -2117,10 +2117,15 @@ config_module_parsers_merge(pool_t pool, struct config_module_parser *dest, /* destination is empty - just copy the whole src */ *dest = *src; if (new_change_counter != 0 && src->set_count > 0) { + dest->settings = + p_new(pool, union config_module_parser_setting, + dest->set_count); dest->change_counters = p_new(pool, uint8_t, dest->set_count); for (unsigned int i = 0; i < dest->set_count; i++) { if (src->change_counters[i] != 0) { + dest->settings[i] = + src->settings[i]; dest->change_counters[i] = new_change_counter; }