summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2005-02-23 20:38:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:44 -0500
commit0a063991a7b2a2a6a7ce537f24be1205d29bc09d (patch)
tree95c89dd00e44ec055d5225bcf02735e1bf9071f5 /source3/lib
parentca9d4c13db2bdd629bf9b97f77c3cb89c4df8676 (diff)
downloadsamba-0a063991a7b2a2a6a7ce537f24be1205d29bc09d.tar.gz
samba-0a063991a7b2a2a6a7ce537f24be1205d29bc09d.tar.bz2
samba-0a063991a7b2a2a6a7ce537f24be1205d29bc09d.zip
r5522: Better handling of LDAP over IPC connections that have expired on the
LDAP-Server. Guenther (This used to be commit 8017a7a150023dc3353181f7737b2363d38593fa)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/smbldap.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index ee03295e72..fec6cc23a8 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -888,7 +888,7 @@ static int smbldap_open(struct smbldap_state *ldap_state)
socklen_t len = sizeof(addr);
int sd;
if (ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_DESC, &sd) == 0 &&
- getpeername(sd, (struct sockaddr *) &addr, &len) < 0) {
+ ((getpeername(sd, (struct sockaddr *) &addr, &len) < 0) || addr.sun_family == AF_LOCAL)) {
/* the other end has died. reopen. */
ldap_unbind_ext(ldap_state->ldap_struct, NULL, NULL);
ldap_state->ldap_struct = NULL;
@@ -962,8 +962,6 @@ static int another_ldap_try(struct smbldap_state *ldap_state, int *rc,
if (*rc != LDAP_SERVER_DOWN)
goto no_next;
- now = time(NULL);
-
if (now >= endtime) {
smbldap_close(ldap_state);
*rc = LDAP_TIMEOUT;
@@ -986,7 +984,6 @@ 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) {