From: Timo Sirainen Date: Thu, 14 Oct 2010 14:59:11 +0000 (+0100) Subject: auth: Give a better error message if pass=yes can't be used in master passdb. X-Git-Tag: 2.0.6~75 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0595524d1fb011498482803e699718031ea74adc;p=thirdparty%2Fdovecot%2Fcore.git auth: Give a better error message if pass=yes can't be used in master passdb. --- diff --git a/src/auth/auth-request.c b/src/auth/auth-request.c index e7a7f90ab5..2deb4c07ae 100644 --- a/src/auth/auth-request.c +++ b/src/auth/auth-request.c @@ -358,6 +358,8 @@ static void auth_request_save_cache(struct auth_request *request, static bool auth_request_master_lookup_finish(struct auth_request *request) { + struct auth_passdb *passdb; + if (request->passdb_failure) return TRUE; @@ -380,6 +382,16 @@ static bool auth_request_master_lookup_finish(struct auth_request *request) /* the authentication continues with passdb lookup for the requested_login_user. */ request->passdb = auth_request_get_auth(request)->passdbs; + + for (passdb = request->passdb; passdb != NULL; passdb = passdb->next) { + if (passdb->passdb->iface.lookup_credentials != NULL) + break; + } + if (passdb == NULL) { + auth_request_log_error(request, "passdb", + "No passdbs support skipping password verification - " + "pass=yes can't be used in master passdb"); + } return FALSE; }