From: Timo Sirainen Date: Thu, 10 Apr 2025 18:06:20 +0000 (+0300) Subject: lib-settings: Fail settings lookups if there are unknown setting overrides X-Git-Tag: 2.4.2~795 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21b607337599d5b3ea1bb6f2aa54f0e5b1c7cc53;p=thirdparty%2Fdovecot%2Fcore.git lib-settings: Fail settings lookups if there are unknown setting overrides This is now safe, because userdb no longer adds unknown settings to overrides. --- diff --git a/src/lib-settings/settings.c b/src/lib-settings/settings.c index 31e8862779..622ae746c5 100644 --- a/src/lib-settings/settings.c +++ b/src/lib-settings/settings.c @@ -1845,9 +1845,9 @@ settings_override_set_blocks(struct settings_mmap *mmap, if (!settings_override_key_part_find(mmap, &key, set->last_filter_key, set->last_filter_value, &set_type, &blocks)) { - /* nonexistent setting */ - set->filter = EVENT_FILTER_MATCH_NEVER; - return 0; + *error_r = t_strdup_printf("Unknown setting '%s' (in %s)", + key, set->orig_key); + return -1; } uint32_t i, count, block_idx; @@ -1939,9 +1939,9 @@ settings_override_filter_match(struct settings_apply_ctx *ctx, last_filter_key, last_filter_value, &set_type, &blocks)) { - /* nonexistent setting */ - set->filter = EVENT_FILTER_MATCH_NEVER; - return 0; + *error_r = t_strdup_printf("Unknown setting '%s' (in %s)", + part, set->orig_key); + return -1; } if (set_type == SET_STRLIST || set_type == SET_BOOLLIST)