From ed1b0c39d71a852b6885363ddced4248a06ff986 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 22 Jun 2010 15:59:44 +0200 Subject: [PATCH 1/1] 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(-) diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c index 227c967c931c..96dabaa81a26 100644 --- a/source3/winbindd/winbindd_ads.c +++ b/source3/winbindd/winbindd_ads.c @@ -547,9 +547,14 @@ 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, &info->primary_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"); -- 2.34.1