changeset 12261:f451ffa51772

auth: Give a better error message if pass=yes can't be used in master passdb.
author Timo Sirainen <tss@iki.fi>
date Thu, 14 Oct 2010 15:59:11 +0100
parents 6ea01abfaea9
children 80a080814041
files src/auth/auth-request.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/auth-request.c	Wed Oct 06 19:49:31 2010 +0100
+++ b/src/auth/auth-request.c	Thu Oct 14 15:59:11 2010 +0100
@@ -358,6 +358,8 @@
 
 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 @@
 	/* 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;
 }