From: Timo Sirainen Date: Sun, 9 Jan 2011 20:01:36 +0000 (+0200) Subject: auth: Don't give an error if doing a passdb lookup and the result has NULL password. X-Git-Tag: 2.0.9~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b24ffea8baa472d9b542e54ed3f9939eefd020ad;p=thirdparty%2Fdovecot%2Fcore.git auth: Don't give an error if doing a passdb lookup and the result has NULL password. --- diff --git a/src/auth/passdb.c b/src/auth/passdb.c index a936e1eef0..c5b19a180c 100644 --- a/src/auth/passdb.c +++ b/src/auth/passdb.c @@ -146,14 +146,18 @@ void passdb_handle_credentials(enum passdb_result result, 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);