Mercurial > dovecot > original-hg > dovecot-1.2
changeset 6243:f4739631ce87 HEAD
Don't crash if blocking passdb doesn't support credential lookups.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 09 Aug 2007 15:05:12 +0300 |
parents | 40e324d83d2b |
children | b2d6becbc1f5 |
files | src/auth/auth-request.c src/auth/auth-worker-client.c |
diffstat | 2 files changed, 12 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/auth/auth-request.c Thu Aug 09 14:48:10 2007 +0300 +++ b/src/auth/auth-request.c Thu Aug 09 15:05:12 2007 +0300 @@ -555,15 +555,15 @@ request->state = AUTH_REQUEST_STATE_PASSDB; - if (passdb->blocking) - passdb_blocking_lookup_credentials(request); - else if (passdb->iface.lookup_credentials != NULL) { - passdb->iface.lookup_credentials(request, - auth_request_lookup_credentials_callback); - } else { + if (passdb->iface.lookup_credentials == NULL) { /* this passdb doesn't support credentials */ auth_request_lookup_credentials_callback( PASSDB_RESULT_SCHEME_NOT_AVAILABLE, NULL, 0, request); + } else if (passdb->blocking) { + passdb_blocking_lookup_credentials(request); + } else { + passdb->iface.lookup_credentials(request, + auth_request_lookup_credentials_callback); } }
--- a/src/auth/auth-worker-client.c Thu Aug 09 14:48:10 2007 +0300 +++ b/src/auth/auth-worker-client.c Thu Aug 09 15:05:12 2007 +0300 @@ -259,6 +259,12 @@ } } + if (auth_request->passdb->passdb->iface.lookup_credentials == NULL) { + i_error("BUG: PASSL lookup not supported by given passdb"); + auth_request_unref(&auth_request); + return; + } + auth_request->passdb->passdb->iface. lookup_credentials(auth_request, lookup_credentials_callback); }