mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
idmap-autorid: Use talloc_tos() in idmap_autorid_sids_to_unixids
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
This commit is contained in:
parent
db3f8ae2bf
commit
f0abb3f3f8
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user