dovecot-2.0: auth: Don't give an error if doing a passdb lookup ...

dovecot at dovecot.org dovecot at dovecot.org
Sun Jan 9 22:01:39 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/ed675e34dfa7
changeset: 12556:ed675e34dfa7
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jan 09 22:01:36 2011 +0200
description:
auth: Don't give an error if doing a passdb lookup and the result has NULL password.

diffstat:

 src/auth/passdb.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (26 lines):

diff -r f043ef71b936 -r ed675e34dfa7 src/auth/passdb.c
--- a/src/auth/passdb.c	Sun Jan 09 21:37:24 2011 +0200
+++ b/src/auth/passdb.c	Sun Jan 09 22:01:36 2011 +0200
@@ -146,14 +146,18 @@
 		return;
 	}
 
-	if (password == NULL) {
+	if (password != NULL) {
+		if (!passdb_get_credentials(auth_request, password, scheme,
+					    &credentials, &size))
+			result = PASSDB_RESULT_SCHEME_NOT_AVAILABLE;
+	} else if (*auth_request->credentials_scheme == '\0') {
+		/* We're doing a passdb lookup (not authenticating).
+		   Pass through a NULL password without an error. */
+	} else {
 		auth_request_log_info(auth_request, "password",
 			"Requested %s scheme, but we have a NULL password",
 			auth_request->credentials_scheme);
 		result = PASSDB_RESULT_SCHEME_NOT_AVAILABLE;
-	} else if (!passdb_get_credentials(auth_request, password, scheme,
-					   &credentials, &size)) {
-		result = PASSDB_RESULT_SCHEME_NOT_AVAILABLE;
 	}
 
 	callback(result, credentials, size, auth_request);


More information about the dovecot-cvs mailing list