From 20501876735fc4656083747ba8aa0de9da8fb820 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 18 Mar 2009 17:35:03 +1100 Subject: s3:libads Make ads_get_dn() take a talloc context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also remove ads_memfree(), which was only ever a wrapper around SAFE_FREE, used only to free the DN from ads_get_ds(). This actually makes libgpo more consistant, as it mixed a talloc and a malloc based string on the same element. Andrew Bartlett Signed-off-by: Günther Deschner --- source3/winbindd/idmap_adex/gc_util.c | 8 ++++---- source3/winbindd/idmap_adex/likewise_cell.c | 4 ++-- source3/winbindd/idmap_adex/provider_unified.c | 6 +++--- source3/winbindd/winbindd_ads.c | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'source3/winbindd') diff --git a/source3/winbindd/idmap_adex/gc_util.c b/source3/winbindd/idmap_adex/gc_util.c index 6dc02336d5..58e641b630 100644 --- a/source3/winbindd/idmap_adex/gc_util.c +++ b/source3/winbindd/idmap_adex/gc_util.c @@ -592,11 +592,11 @@ done: while (e) { struct winbindd_tdc_domain *domain_rec; - dn = ads_get_dn(ads, e); + dn = ads_get_dn(ads, frame, e); BAIL_ON_PTR_ERROR(dn, nt_status); dns_domain = cell_dn_to_dns(dn); - SAFE_FREE(dn); + TALLOC_FREE(dn); BAIL_ON_PTR_ERROR(dns_domain, nt_status); domain_rec = wcache_tdc_fetch_domain(frame, dns_domain); @@ -666,13 +666,13 @@ static NTSTATUS get_object_account_name(ADS_STRUCT *ads, /* get the name and domain */ - dn = ads_get_dn(ads, msg); + dn = ads_get_dn(ads, frame, msg); BAIL_ON_PTR_ERROR(dn, nt_status); DEBUG(10,("get_object_account_name: dn = \"%s\"\n", dn)); dns_domain = cell_dn_to_dns(dn); - SAFE_FREE(dn); + TALLOC_FREE(dn); BAIL_ON_PTR_ERROR(dns_domain, nt_status); domain_rec = wcache_tdc_fetch_domain(frame, dns_domain); diff --git a/source3/winbindd/idmap_adex/likewise_cell.c b/source3/winbindd/idmap_adex/likewise_cell.c index 7723b3e015..7354a367b8 100644 --- a/source3/winbindd/idmap_adex/likewise_cell.c +++ b/source3/winbindd/idmap_adex/likewise_cell.c @@ -400,10 +400,10 @@ done: e!=NULL; e = ads_next_entry(c->conn, e)) { - char *dn = ads_get_dn(c->conn, e); + char *dn = ads_get_dn(c->conn, NULL, e); DEBUGADD(10,(" dn: %s\n", dn ? dn : "")); - SAFE_FREE(dn); + TALLOC_FREE(dn); } } diff --git a/source3/winbindd/idmap_adex/provider_unified.c b/source3/winbindd/idmap_adex/provider_unified.c index f18534797e..9134eb4e64 100644 --- a/source3/winbindd/idmap_adex/provider_unified.c +++ b/source3/winbindd/idmap_adex/provider_unified.c @@ -368,7 +368,7 @@ static NTSTATUS check_result_unique_scoped(ADS_STRUCT **ads_list, LDAPMessage *e = ads_first_entry(ads_list[i], msg_list[i]); while (e) { - entry_dn = ads_get_dn(ads_list[i], e); + entry_dn = ads_get_dn(ads_list[i], NULL, e); BAIL_ON_PTR_ERROR(entry_dn, nt_status); if (check_forest_scope(entry_dn)) { @@ -389,7 +389,7 @@ static NTSTATUS check_result_unique_scoped(ADS_STRUCT **ads_list, } e = ads_next_entry(ads_list[i], e); - SAFE_FREE(entry_dn); + TALLOC_FREE(entry_dn); } } @@ -439,7 +439,7 @@ done: } talloc_destroy(frame); - SAFE_FREE(entry_dn); + TALLOC_FREE(entry_dn); return nt_status; } diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c index a76faa7a25..dcf5623d29 100644 --- a/source3/winbindd/winbindd_ads.c +++ b/source3/winbindd/winbindd_ads.c @@ -865,7 +865,7 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain, goto done; } - user_dn = ads_get_dn(ads, msg); + user_dn = ads_get_dn(ads, mem_ctx, msg); if (user_dn == NULL) { status = NT_STATUS_NO_MEMORY; goto done; @@ -942,7 +942,7 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain, DEBUG(3,("ads lookup_usergroups (tokenGroups) succeeded for sid=%s\n", sid_string_dbg(sid))); done: - ads_memfree(ads, user_dn); + TALLOC_FREE(user_dn); ads_msgfree(ads, msg); return status; } -- cgit