r4289: Close LDAP-Connection before retrying to open a new connection in the
authorGünther Deschner <gd@samba.org>
Mon, 20 Dec 2004 18:42:58 +0000 (18:42 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:53:42 +0000 (10:53 -0500)
retry-loop.

This fixes a deadlock-situation when ldapsam is used with the ldapi
interface: getpeername won't fail while trying to detect dead
connections on unix domain sockets. When the ldapi-connection was closed
server-side (due to OpenLDAP's idletimeout) we *never* got a new LDAP
connection.

Guenther
(This used to be commit ac8032bacff10451fa03f155d43f0d20389512fa)

source3/lib/smbldap.c

index 7e485457b084a3158175942d5260bbe8a3bd8fe5..4afafde9bb61feb5b224177f3bf9098bb860ff20 100644 (file)
@@ -977,6 +977,7 @@ static int another_ldap_try(struct smbldap_state *ldap_state, int *rc,
 
                *attempts += 1;
 
+               smbldap_close(ldap_state);
                open_rc = smbldap_open(ldap_state);
 
                if (open_rc == LDAP_SUCCESS) {