summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-03-08 21:33:58 +0100
committerVolker Lendecke <vl@samba.org>2011-03-18 15:46:36 +0100
commitf0abb3f3f81f213c543b857a74451d84434cdd21 (patch)
tree2dede0209b3924f45c587fd35ca87fdcc5c9c05a /source3
parentdb3f8ae2bfe03dc67a76398f54845f0ef348971c (diff)
downloadsamba-f0abb3f3f81f213c543b857a74451d84434cdd21.tar.gz
samba-f0abb3f3f81f213c543b857a74451d84434cdd21.tar.bz2
samba-f0abb3f3f81f213c543b857a74451d84434cdd21.zip
idmap-autorid: Use talloc_tos() in idmap_autorid_sids_to_unixids
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/idmap_autorid.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c
index 73121e120f..45f61f04b3 100644
--- a/source3/winbindd/idmap_autorid.c
+++ b/source3/winbindd/idmap_autorid.c
@@ -272,7 +272,6 @@ static NTSTATUS idmap_autorid_sids_to_unixids(struct idmap_domain *dom,
struct id_map **ids)
{
struct autorid_global_config *global;
- struct winbindd_tdc_domain *domain;
TALLOC_CTX *ctx;
NTSTATUS ret;
int i;
@@ -293,27 +292,32 @@ static NTSTATUS idmap_autorid_sids_to_unixids(struct idmap_domain *dom,
struct autorid_global_config);
for (i = 0; ids[i]; i++) {
+ struct winbindd_tdc_domain *domain;
struct autorid_domain_config domaincfg;
- struct dom_sid domainsid;
uint32_t rid;
- sid_copy(&domainsid, ids[i]->sid);
- if (!sid_split_rid(&domainsid, &rid)) {
+ ZERO_STRUCT(domaincfg);
+
+ sid_copy(&domaincfg.sid, ids[i]->sid);
+ if (!sid_split_rid(&domaincfg.sid, &rid)) {
DEBUG(4, ("Could not determine domain SID from %s, "
"ignoring mapping request\n",
sid_string_dbg(ids[i]->sid)));
continue;
}
- domain = wcache_tdc_fetch_domainbysid(ctx, &domainsid);
+ /*
+ * Check if the domain is around
+ */
+ domain = wcache_tdc_fetch_domainbysid(talloc_tos(),
+ &domaincfg.sid);
if (domain == NULL) {
DEBUG(10, ("Ignoring unknown domain sid %s\n",
- sid_string_dbg(&domainsid)));
+ sid_string_dbg(&domaincfg.sid)));
continue;
}
+ TALLOC_FREE(domain);
- ZERO_STRUCT(domaincfg);
- domaincfg.sid = domain->sid;
domaincfg.globalcfg = global;
ret = dbwrap_trans_do(autorid_db,