From 899d2abd612fb7c3f6f274e754e198f1bbc2b742 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 8 Dec 2010 15:03:59 +0100 Subject: [PATCH 1/4] Revert "s3: Fix bug 7832" - imho, this should be done differently. This reverts commit d6337bb1bea8698f7532ef5be83de3c75376f09b. --- source3/winbindd/idmap_ad.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c index bc1a1e5..1567598 100644 --- a/source3/winbindd/idmap_ad.c +++ b/source3/winbindd/idmap_ad.c @@ -859,7 +859,6 @@ static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e, /* See if we can use the ADS connection struct swe were given */ -#if 0 if (ads) { DEBUG(10, ("nss_ad_get_info: using given ads connection and " "LDAP message (%p)\n", msg)); @@ -876,7 +875,6 @@ static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e, nt_status = NT_STATUS_OK; goto done; } -#endif /* Have to do our own query */ -- 1.6.3.3 From 3701781afeccc433dfbbc7ad5425184bef067c6a Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 8 Dec 2010 15:15:28 +0100 Subject: [PATCH 2/4] s3:winbind: fix bug #7832 - segfault in nss_info ad usage. In nss_ad_get_info(), check whether the ldap msg is NULL before using it. --- source3/winbindd/idmap_ad.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c index 1567598..950c22f 100644 --- a/source3/winbindd/idmap_ad.c +++ b/source3/winbindd/idmap_ad.c @@ -859,7 +859,7 @@ static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e, /* See if we can use the ADS connection struct swe were given */ - if (ads) { + if (ads && msg) { DEBUG(10, ("nss_ad_get_info: using given ads connection and " "LDAP message (%p)\n", msg)); -- 1.6.3.3 From c673731a6805f20b19dd5de05987f8b65879d120 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 8 Dec 2010 16:48:38 +0100 Subject: [PATCH 3/4] s3:winbindd: in ads query_user_list, pass NULL ads and message to nss_get_info_cached The messages is NULL anyways. So the ads struct will not be used. If nss_get_info_cached should use the msg and ads connection, then we would need to copy the structs in the previous loop, one for each result found. --- source3/winbindd/winbindd_ads.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c index 6acdc0b..ec43029 100644 --- a/source3/winbindd/winbindd_ads.c +++ b/source3/winbindd/winbindd_ads.c @@ -251,8 +251,8 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain, * the domain. */ status = nss_get_info_cached(domain, &info->user_sid, mem_ctx, - ads_cached_connection(domain), - msg, &info->homedir, &info->shell, + NULL, NULL, + &info->homedir, &info->shell, &gecos, &primary_gid); if (!NT_STATUS_IS_OK(status)) { /* -- 1.6.3.3 From abed638fd5e6a90b4a5af1bd1242a74570b7f4b9 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 8 Dec 2010 16:51:42 +0100 Subject: [PATCH 4/4] s3:winbindd: in ads query_user, explicitly pass NULL as ads and msg to nss_get_info_cached msg is NULL anyways, and hence neither ads nor msg would get used by nss_get_info_cached. --- source3/winbindd/winbindd_ads.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c index ec43029..7f25b34 100644 --- a/source3/winbindd/winbindd_ads.c +++ b/source3/winbindd/winbindd_ads.c @@ -588,7 +588,7 @@ static NTSTATUS query_user(struct winbindd_domain *domain, ads_msgfree(ads, msg); msg = NULL; - status = nss_get_info_cached( domain, sid, mem_ctx, ads, msg, + status = nss_get_info_cached( domain, sid, mem_ctx, NULL, NULL, &info->homedir, &info->shell, &info->full_name, &gid); info->primary_gid = gid; -- 1.6.3.3