[dovecot-cvs] dovecot/src/auth auth-request.c, 1.27,
1.28 auth-request.h, 1.17, 1.18
cras at dovecot.org
cras at dovecot.org
Sat Sep 24 13:50:40 EEST 2005
Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv1009
Modified Files:
auth-request.c auth-request.h
Log Message:
If passdb lookup fails with internal error, try other passdbs anyway before
returning internal failure.
Index: auth-request.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-request.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- auth-request.c 7 Aug 2005 11:41:19 -0000 1.27
+++ auth-request.c 24 Sep 2005 10:50:38 -0000 1.28
@@ -237,9 +237,10 @@
}
if (result != PASSDB_RESULT_OK &&
- result != PASSDB_RESULT_INTERNAL_FAILURE &&
request->passdb->next != NULL) {
/* try next passdb. */
+ if (result == PASSDB_RESULT_INTERNAL_FAILURE)
+ request->passdb_internal_failure = TRUE;
if (request->extra_fields != NULL)
auth_stream_reply_reset(request->extra_fields);
@@ -250,6 +251,13 @@
return;
}
+ if (request->passdb_internal_failure && result != PASSDB_RESULT_OK) {
+ /* one of the passdb lookups returned internal failure.
+ it may have had the correct password, so return internal
+ failure instead of plain failure. */
+ result = PASSDB_RESULT_INTERNAL_FAILURE;
+ }
+
auth_request_ref(request);
request->private_callback.verify_plain(result, request);
safe_memset(request->mech_password, 0, strlen(request->mech_password));
Index: auth-request.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-request.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- auth-request.h 7 Aug 2005 11:41:19 -0000 1.17
+++ auth-request.h 24 Sep 2005 10:50:38 -0000 1.18
@@ -52,6 +52,7 @@
unsigned int successful:1;
unsigned int internal_failure:1;
+ unsigned int passdb_internal_failure:1;
unsigned int delayed_failure:1;
unsigned int accept_input:1;
unsigned int no_failure_delay:1;
More information about the dovecot-cvs
mailing list