dovecot-1.0: Don't crash if blocking passdb doesn't support cred...
dovecot at dovecot.org
dovecot at dovecot.org
Thu Aug 9 15:05:19 EEST 2007
details: http://hg.dovecot.org/dovecot-1.0/rev/870e4d1cf2b3
changeset: 5373:870e4d1cf2b3
user: Timo Sirainen <tss at iki.fi>
date: Thu Aug 09 15:05:15 2007 +0300
description:
Don't crash if blocking passdb doesn't support credential lookups.
diffstat:
2 files changed, 12 insertions(+), 6 deletions(-)
src/auth/auth-request.c | 12 ++++++------
src/auth/auth-worker-client.c | 6 ++++++
diffs (41 lines):
diff -r d2da308f55d3 -r 870e4d1cf2b3 src/auth/auth-request.c
--- a/src/auth/auth-request.c Thu Aug 09 14:48:11 2007 +0300
+++ b/src/auth/auth-request.c Thu Aug 09 15:05:15 2007 +0300
@@ -532,15 +532,15 @@ void auth_request_lookup_credentials(str
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, request);
+ } else if (passdb->blocking) {
+ passdb_blocking_lookup_credentials(request);
+ } else {
+ passdb->iface.lookup_credentials(request,
+ auth_request_lookup_credentials_callback);
}
}
diff -r d2da308f55d3 -r 870e4d1cf2b3 src/auth/auth-worker-client.c
--- a/src/auth/auth-worker-client.c Thu Aug 09 14:48:11 2007 +0300
+++ b/src/auth/auth-worker-client.c Thu Aug 09 15:05:15 2007 +0300
@@ -239,6 +239,12 @@ auth_worker_handle_passl(struct auth_wor
}
}
+ 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);
}
More information about the dovecot-cvs
mailing list