From: Timo Sirainen Date: Wed, 8 Sep 2010 13:55:57 +0000 (+0100) Subject: auth: Fail if auth_cache_size value is too small. X-Git-Tag: 2.0.2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4fc74bba3548987b7e8597491cd9fafc1f701be6;p=thirdparty%2Fdovecot%2Fcore.git auth: Fail if auth_cache_size value is too small. --- diff --git a/src/auth/auth-settings.c b/src/auth/auth-settings.c index d492e11c1e..6911757631 100644 --- a/src/auth/auth-settings.c +++ b/src/auth/auth-settings.c @@ -256,7 +256,7 @@ const struct setting_parser_info auth_setting_parser_info = { /* */ 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,