dovecot-2.2: auth ldap: Fixed assert-crash when both passdb ldap...

dovecot at dovecot.org dovecot at dovecot.org
Tue Mar 17 07:59:07 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/870cb73e5960
changeset: 18362:870cb73e5960
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Mar 17 09:58:03 2015 +0200
description:
auth ldap: Fixed assert-crash when both passdb ldap and userdb ldap was used

diffstat:

 src/auth/db-ldap.c |  10 ++++++++--
 src/auth/db-ldap.h |   1 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r 0a17875f0ece -r 870cb73e5960 src/auth/db-ldap.c
--- a/src/auth/db-ldap.c	Mon Mar 16 23:25:34 2015 +0200
+++ b/src/auth/db-ldap.c	Tue Mar 17 09:58:03 2015 +0200
@@ -1155,8 +1155,11 @@
 			memset(&start, 0, sizeof(start));
 	}
 	i_assert(conn->pending_count == 0);
-	if (conn->to != NULL)
+
+	if (conn->delayed_connect) {
+		conn->delayed_connect = FALSE;
 		timeout_remove(&conn->to);
+	}
 	if (conn->ld == NULL)
 		db_ldap_init_ld(conn);
 
@@ -1225,8 +1228,11 @@
 
 void db_ldap_connect_delayed(struct ldap_connection *conn)
 {
+	if (conn->delayed_connect)
+		return;
+	conn->delayed_connect = TRUE;
+
 	i_assert(conn->to == NULL);
-
 	conn->to = timeout_add_short(0, db_ldap_connect_callback, conn);
 }
 
diff -r 0a17875f0ece -r 870cb73e5960 src/auth/db-ldap.h
--- a/src/auth/db-ldap.h	Mon Mar 16 23:25:34 2015 +0200
+++ b/src/auth/db-ldap.h	Tue Mar 17 09:58:03 2015 +0200
@@ -176,6 +176,7 @@
 	char **pass_attr_names, **user_attr_names, **iterate_attr_names;
 	ARRAY_TYPE(ldap_field) pass_attr_map, user_attr_map, iterate_attr_map;
 	bool userdb_used;
+	bool delayed_connect;
 };
 
 /* Send/queue request */


More information about the dovecot-cvs mailing list