summaryrefslogtreecommitdiff
path: root/source3/lib/smbldap.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/smbldap.c')
-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) {