From 0a063991a7b2a2a6a7ce537f24be1205d29bc09d Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 23 Feb 2005 20:38:29 +0000 Subject: r5522: Better handling of LDAP over IPC connections that have expired on the LDAP-Server. Guenther (This used to be commit 8017a7a150023dc3353181f7737b2363d38593fa) --- source3/lib/smbldap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source3/lib/smbldap.c') 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) { -- cgit