summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-06-22 15:59:44 +0200
committerVolker Lendecke <vl@samba.org>2010-06-25 12:54:15 +0200
commita9523f17ea2cd85a130e081f3a89cffbee1fdc06 (patch)
tree2dce4c2779dc45e1d8121b02d260f9d023397233 /source3/winbindd
parent5c98ccd70601c475f3bcb34e6a233069c9f542f6 (diff)
downloadsamba-a9523f17ea2cd85a130e081f3a89cffbee1fdc06.tar.gz
samba-a9523f17ea2cd85a130e081f3a89cffbee1fdc06.tar.bz2
samba-a9523f17ea2cd85a130e081f3a89cffbee1fdc06.zip
s3: Fix a winbind crash
nss_get_info_cached might have invalidated "ads" deep inside.
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd_ads.c7
1 files changed, 6 insertions, 1 deletions
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");