summaryrefslogtreecommitdiffstats
path: root/source/libads/ldap_utils.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-10-03 21:43:09 +0000
committerGerald Carter <jerry@samba.org>2003-10-03 21:43:09 +0000
commit1cfbd92404270e0c67a3b295fc9cf461b29d3503 (patch)
tree8a6a5aacbd91605884c8b1f1152dc26c5dfd3ba3 /source/libads/ldap_utils.c
parentdfbde4be7191895d79762855b21f5c62d53d5267 (diff)
downloadsamba-1cfbd92404270e0c67a3b295fc9cf461b29d3503.tar.gz
samba-1cfbd92404270e0c67a3b295fc9cf461b29d3503.tar.xz
samba-1cfbd92404270e0c67a3b295fc9cf461b29d3503.zip
don't call ads_destroy() twice; fixes segfault in winbindd when DC goes down; bug 437
Diffstat (limited to 'source/libads/ldap_utils.c')
-rw-r--r--source/libads/ldap_utils.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/libads/ldap_utils.c b/source/libads/ldap_utils.c
index 1fa9ebfc975..4142bceabca 100644
--- a/source/libads/ldap_utils.c
+++ b/source/libads/ldap_utils.c
@@ -54,15 +54,20 @@ ADS_STATUS ads_do_search_retry(ADS_STRUCT *ads, const char *bind_path, int scope
return status;
}
- if (*res) ads_msgfree(ads, *res);
+ if (*res)
+ ads_msgfree(ads, *res);
*res = NULL;
+
DEBUG(3,("Reopening ads connection to realm '%s' after error %s\n",
ads->config.realm, ads_errstr(status)));
+
if (ads->ld) {
ldap_unbind(ads->ld);
}
+
ads->ld = NULL;
status = ads_connect(ads);
+
if (!ADS_ERR_OK(status)) {
DEBUG(1,("ads_search_retry: failed to reconnect (%s)\n",
ads_errstr(status)));