From f0abb3f3f81f213c543b857a74451d84434cdd21 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 8 Mar 2011 21:33:58 +0100 Subject: idmap-autorid: Use talloc_tos() in idmap_autorid_sids_to_unixids Signed-off-by: Christian Ambach --- source3/winbindd/idmap_autorid.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'source3') 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, -- cgit