dovecot-1.0: If ldap_bind() failed because LDAP server was down,...

dovecot at dovecot.org dovecot at dovecot.org
Sun Oct 21 00:03:24 EEST 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/8dcc215fbc06
changeset: 5425:8dcc215fbc06
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Oct 21 00:03:20 2007 +0300
description:
If ldap_bind() failed because LDAP server was down, we never reconnected.
Patch by Brendan Braybrook.

diffstat:

1 file changed, 4 insertions(+), 1 deletion(-)
src/auth/db-ldap.c |    5 ++++-

diffs (15 lines):

diff -r 74f69026f8e2 -r 8dcc215fbc06 src/auth/db-ldap.c
--- a/src/auth/db-ldap.c	Tue Oct 16 19:22:16 2007 +0300
+++ b/src/auth/db-ldap.c	Sun Oct 21 00:03:20 2007 +0300
@@ -485,7 +485,10 @@ static int db_ldap_bind(struct ldap_conn
 	msgid = ldap_bind(conn->ld, conn->set.dn, conn->set.dnpass,
 			  LDAP_AUTH_SIMPLE);
 	if (msgid == -1) {
-		db_ldap_connect_finish(conn, ldap_get_errno(conn));
+		if (db_ldap_connect_finish(conn, ldap_get_errno(conn)) < 0) {
+			/* lost connection, close it */
+			ldap_conn_close(conn, TRUE);
+		}
 		i_free(ldap_request);
 		return -1;
 	}


More information about the dovecot-cvs mailing list