dovecot-1.0: If auth cache contained credentials in wrong scheme...

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 13 17:51:44 EEST 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/59882181925a
changeset: 5382:59882181925a
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 13 17:51:41 2007 +0300
description:
If auth cache contained credentials in wrong scheme, we crashed.

diffstat:

1 file changed, 7 insertions(+), 8 deletions(-)
src/auth/auth-request.c |   15 +++++++--------

diffs (32 lines):

diff -r 5e347c7daefd -r 59882181925a src/auth/auth-request.c
--- a/src/auth/auth-request.c	Thu Aug 09 22:09:02 2007 +0300
+++ b/src/auth/auth-request.c	Mon Aug 13 17:51:41 2007 +0300
@@ -493,9 +493,10 @@ void auth_request_lookup_credentials_cal
 						    &result, TRUE)) {
 			auth_request_log_info(request, "passdb",
 				"Fallbacking to expired data from cache");
-			password = result != PASSDB_RESULT_OK ? NULL :
-				passdb_get_credentials(request, password,
-						       scheme);
+			passdb_handle_credentials(result, password, scheme,
+				auth_request_lookup_credentials_callback_finish,
+				request);
+			return;
 		}
 	}
 
@@ -521,11 +522,9 @@ void auth_request_lookup_credentials(str
 		if (passdb_cache_lookup_credentials(request, cache_key,
 						    &password, &scheme,
 						    &result, FALSE)) {
-			password = result != PASSDB_RESULT_OK ? NULL :
-				passdb_get_credentials(request, password,
-						       scheme);
-			auth_request_lookup_credentials_callback_finish(
-				result, password, request);
+			passdb_handle_credentials(result, password, scheme,
+				auth_request_lookup_credentials_callback_finish,
+				request);
 			return;
 		}
 	}


More information about the dovecot-cvs mailing list