# HG changeset patch # User Timo Sirainen # Date 1186661112 -10800 # Node ID f4739631ce875225b23bec07392a84bf6f6d74af # Parent 40e324d83d2bf8f445eda5862c2e7ee920056aa0 Don't crash if blocking passdb doesn't support credential lookups. diff -r 40e324d83d2b -r f4739631ce87 src/auth/auth-request.c --- 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); } } diff -r 40e324d83d2b -r f4739631ce87 src/auth/auth-worker-client.c --- 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); }