dovecot-2.2: ldap: Treat "No such object" errors to search the s...

dovecot at dovecot.org dovecot at dovecot.org
Fri Aug 15 11:07:34 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/5e818f1b376d
changeset: 17715:5e818f1b376d
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Aug 15 14:05:21 2014 +0300
description:
ldap: Treat "No such object" errors to search the same as if no results were returned.
Trying to look up a nonexistent base returns this error.

diffstat:

 src/auth/db-ldap.c |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (14 lines):

diff -r 14082c2d81dd -r 5e818f1b376d src/auth/db-ldap.c
--- a/src/auth/db-ldap.c	Fri Aug 15 13:58:47 2014 +0300
+++ b/src/auth/db-ldap.c	Fri Aug 15 14:05:21 2014 +0300
@@ -760,7 +760,9 @@
 		final_result = TRUE;
 		ret = ldap_result2error(conn->ld, res->msg, 0);
 	}
-	if (ret != LDAP_SUCCESS && request->type == LDAP_REQUEST_TYPE_SEARCH) {
+	/* LDAP_NO_SUCH_OBJECT is returned for nonexistent base */
+	if (ret != LDAP_SUCCESS && ret != LDAP_NO_SUCH_OBJECT &&
+	    request->type == LDAP_REQUEST_TYPE_SEARCH) {
 		/* handle search failures here */
 		struct ldap_request_search *srequest =
 			(struct ldap_request_search *)request;


More information about the dovecot-cvs mailing list