From: Timo Sirainen Date: Thu, 15 Mar 2012 10:59:41 +0000 (+0200) Subject: auth: If global passdb is missing, don't complain if protocol x and !x { passdb ... X-Git-Tag: 2.1.2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b2a1f819dba39cc2af722ce7bce1f34fe5f71fe;p=thirdparty%2Fdovecot%2Fcore.git auth: If global passdb is missing, don't complain if protocol x and !x { passdb } exists. --- diff --git a/src/auth/auth.c b/src/auth/auth.c index a72a1de201..5c2d605ab0 100644 --- a/src/auth/auth.c +++ b/src/auth/auth.c @@ -194,7 +194,6 @@ auth_preinit(const struct auth_settings *set, const char *service, pool_t pool, /* use a dummy userdb static. */ auth_userdb_preinit(auth, &userdb_dummy_set); } - auth_mech_list_verify_passdb(auth); return auth; } @@ -251,9 +250,10 @@ void auths_preinit(const struct auth_settings *set, pool_t pool, { struct master_service_settings_output set_output; const struct auth_settings *service_set; - struct auth *auth; + struct auth *auth, *const *authp; unsigned int i; const char *not_service = NULL; + bool check_default = TRUE; i_array_init(&auths, 8); @@ -274,6 +274,14 @@ void auths_preinit(const struct auth_settings *set, pool_t pool, auth = auth_preinit(service_set, services[i], pool, reg); array_append(&auths, &auth, 1); } + + if (not_service != NULL && str_array_find(services, not_service+1)) + check_default = FALSE; + + array_foreach(&auths, authp) { + if ((*authp)->service != NULL || check_default) + auth_mech_list_verify_passdb(*authp); + } } void auths_init(void)