]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-settings: Fail settings lookups if there are unknown setting overrides
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 10 Apr 2025 18:06:20 +0000 (21:06 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Mon, 12 May 2025 15:51:47 +0000 (15:51 +0000)
This is now safe, because userdb no longer adds unknown settings to
overrides.

src/lib-settings/settings.c

index 31e8862779dffa93de9642f7b638f32a72dfcc3d..622ae746c5b2052b3d10c1590b405a982a037cae 100644 (file)
@@ -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)