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/nsswitch/winbindd_ads.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source3/nsswitch/winbindd_ads.c') diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c index c64359a224..ef3f0f8fc2 100644 --- a/source3/nsswitch/winbindd_ads.c +++ b/source3/nsswitch/winbindd_ads.c @@ -787,9 +787,13 @@ static NTSTATUS sequence_number(struct winbindd_domain *domain, uint32 *seq) } rc = ads_USN(ads, seq); + if (!ADS_ERR_OK(rc)) { - /* its a dead connection */ - ads_destroy(&ads); + + /* its a dead connection ; don't destroy it + through since ads_USN() has already done + that indirectly */ + domain->private = NULL; } return ads_ntstatus(rc); @@ -910,8 +914,11 @@ static NTSTATUS domain_sid(struct winbindd_domain *domain, DOM_SID *sid) rc = ads_domain_sid(ads, sid); if (!ADS_ERR_OK(rc)) { - /* its a dead connection */ - ads_destroy(&ads); + + /* its a dead connection; don't destroy it though + since that has already been done indirectly + by ads_domain_sid() */ + domain->private = NULL; } -- cgit