From 48958b0105dce32888497e79106e08c70af7e3ef Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 3 Oct 2003 21:43:09 +0000 Subject: don't call ads_destroy() twice; fixes segfault in winbindd when DC goes down; bug 437 (This used to be commit 1cfbd92404270e0c67a3b295fc9cf461b29d3503) --- source3/libads/ldap_utils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/libads/ldap_utils.c') diff --git a/source3/libads/ldap_utils.c b/source3/libads/ldap_utils.c index 1fa9ebfc97..4142bceabc 100644 --- a/source3/libads/ldap_utils.c +++ b/source3/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))); -- cgit