From a9523f17ea2cd85a130e081f3a89cffbee1fdc06 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 22 Jun 2010 15:59:44 +0200 Subject: s3: Fix a winbind crash nss_get_info_cached might have invalidated "ads" deep inside. --- source3/winbindd/winbindd_ads.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/winbindd/winbindd_ads.c') diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c index faa4d8ee26..92e1188714 100644 --- a/source3/winbindd/winbindd_ads.c +++ b/source3/winbindd/winbindd_ads.c @@ -549,10 +549,15 @@ static NTSTATUS query_user(struct winbindd_domain *domain, info->acct_name = ads_pull_username(ads, mem_ctx, msg); - nss_get_info_cached( domain, sid, mem_ctx, ads, msg, + status = nss_get_info_cached( domain, sid, mem_ctx, ads, msg, &info->homedir, &info->shell, &info->full_name, &gid); info->primary_gid = gid; + if (!NT_STATUS_IS_OK(status)) { + DEBUG(1, ("nss_get_info_cached failed: %s\n", + nt_errstr(status))); + goto done; + } if (info->full_name == NULL) { info->full_name = ads_pull_string(ads, mem_ctx, msg, "name"); -- cgit