]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Fail if auth_cache_size value is too small.
authorTimo Sirainen <tss@iki.fi>
Wed, 8 Sep 2010 13:55:57 +0000 (14:55 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 8 Sep 2010 13:55:57 +0000 (14:55 +0100)
src/auth/auth-settings.c

index d492e11c1e480e6e2b1b88029b4b0911b082caf0..6911757631e5d7063970c35916e8bb0a23ba1c20 100644 (file)
@@ -256,7 +256,7 @@ const struct setting_parser_info auth_setting_parser_info = {
 
 /* <settings checks> */
 static bool auth_settings_check(void *_set, pool_t pool,
-                               const char **error_r ATTR_UNUSED)
+                               const char **error_r)
 {
        struct auth_settings *set = _set;
        const char *p;
@@ -266,6 +266,15 @@ static bool auth_settings_check(void *_set, pool_t pool,
        if (set->debug)
                set->verbose = TRUE;
 
+       if (set->cache_size < 1024) {
+               /* probably a configuration error.
+                  older versions used megabyte numbers */
+               *error_r = t_strdup_printf("auth_cache_size value is too small "
+                                          "(%"PRIuUOFF_T" bytes)",
+                                          set->cache_size);
+               return FALSE;
+       }
+
        if (*set->username_chars == '\0') {
                /* all chars are allowed */
                memset(set->username_chars_map, 1,