summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-05-28 11:18:22 +0200
committerVolker Lendecke <vl@samba.org>2009-05-28 11:33:21 +0200
commit0dbecbbee5018108131869b13db649a058f4359d (patch)
treee49b14064ea1f1e27b55f65a9c32ab6a70151fd6 /source3/winbindd
parent01ea4249da246b0b99a4b89eb36aa6b1c0d46994 (diff)
downloadsamba-0dbecbbee5018108131869b13db649a058f4359d.tar.gz
samba-0dbecbbee5018108131869b13db649a058f4359d.tar.bz2
samba-0dbecbbee5018108131869b13db649a058f4359d.zip
Make sid_binstring & friends take a talloc context
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/idmap_ad.c8
-rw-r--r--source3/winbindd/winbindd_ads.c14
2 files changed, 10 insertions, 12 deletions
diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c
index 5c29ba0b22..3791a86876 100644
--- a/source3/winbindd/idmap_ad.c
+++ b/source3/winbindd/idmap_ad.c
@@ -570,10 +570,10 @@ again:
ids[idx]->status = ID_UNKNOWN;
- sidstr = sid_binstring(ids[idx]->sid);
+ sidstr = sid_binstring(talloc_tos(), ids[idx]->sid);
filter = talloc_asprintf_append_buffer(filter, "(objectSid=%s)", sidstr);
- free(sidstr);
+ TALLOC_FREE(sidstr);
CHECK_ALLOC_DONE(filter);
}
filter = talloc_asprintf_append_buffer(filter, "))");
@@ -894,9 +894,9 @@ static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e,
attrs[2] = ctx->ad_schema->posix_gecos_attr;
attrs[3] = ctx->ad_schema->posix_gidnumber_attr;
- sidstr = sid_binstring(sid);
+ sidstr = sid_binstring(mem_ctx, sid);
filter = talloc_asprintf(mem_ctx, "(objectSid=%s)", sidstr);
- SAFE_FREE(sidstr);
+ TALLOC_FREE(sidstr);
if (!filter) {
nt_status = NT_STATUS_NO_MEMORY;
diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
index dcf5623d29..0f40419a0e 100644
--- a/source3/winbindd/winbindd_ads.c
+++ b/source3/winbindd/winbindd_ads.c
@@ -524,14 +524,14 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
goto done;
}
- sidstr = sid_binstring(sid);
+ sidstr = sid_binstring(talloc_tos(), sid);
if (asprintf(&ldap_exp, "(objectSid=%s)", sidstr) == -1) {
status = NT_STATUS_NO_MEMORY;
goto done;
}
rc = ads_search_retry(ads, &msg, ldap_exp, attrs);
free(ldap_exp);
- free(sidstr);
+ TALLOC_FREE(sidstr);
if (!ADS_ERR_OK(rc) || !msg) {
DEBUG(1,("query_user(sid=%s) ads_search: %s\n",
sid_string_dbg(sid), ads_errstr(rc)));
@@ -1011,21 +1011,19 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
goto done;
}
- if ((sidbinstr = sid_binstring(group_sid)) == NULL) {
+ if ((sidbinstr = sid_binstring(talloc_tos(), group_sid)) == NULL) {
status = NT_STATUS_NO_MEMORY;
goto done;
}
/* search for all members of the group */
- if (!(ldap_exp = talloc_asprintf(tmp_ctx, "(objectSid=%s)",
- sidbinstr)))
- {
- SAFE_FREE(sidbinstr);
+ ldap_exp = talloc_asprintf(tmp_ctx, "(objectSid=%s)", sidbinstr);
+ TALLOC_FREE(sidbinstr);
+ if (ldap_exp == NULL) {
DEBUG(1, ("ads: lookup_groupmem: talloc_asprintf for ldap_exp failed!\n"));
status = NT_STATUS_NO_MEMORY;
goto done;
}
- SAFE_FREE(sidbinstr);
args.control = ADS_EXTENDED_DN_OID;
args.val = ADS_EXTENDED_DN_HEX_STRING;