summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-01-23 13:32:45 +0000
committerJeremy Allison <jra@samba.org>2015-02-27 22:53:06 +0100
commit200d0bc3a870f1d7d3c5bcf33fceaa2b99e8299f (patch)
treeae3720876c8477aaeea7838dedaba271f54c64dd
parentc6577f3043acfd649511011894554250bfbe7761 (diff)
downloadsamba-200d0bc3a870f1d7d3c5bcf33fceaa2b99e8299f.tar.gz
samba-200d0bc3a870f1d7d3c5bcf33fceaa2b99e8299f.tar.xz
samba-200d0bc3a870f1d7d3c5bcf33fceaa2b99e8299f.zip
winbind: Slightly simplify wb_sids2xids
We only needs "names" and "domains" wb_sids2xids_lookupsids_done. It confused me when reading this code that these variables are stored in "state". Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/winbindd/wb_sids2xids.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source3/winbindd/wb_sids2xids.c b/source3/winbindd/wb_sids2xids.c
index 3e6f235257..76149743f0 100644
--- a/source3/winbindd/wb_sids2xids.c
+++ b/source3/winbindd/wb_sids2xids.c
@@ -36,9 +36,6 @@ struct wb_sids2xids_state {
struct dom_sid *non_cached;
uint32_t num_non_cached;
- struct lsa_RefDomainList *domains;
- struct lsa_TransNameArray *names;
-
/*
* Domain array to use for the idmap call. The output from
* lookupsids cannot be used directly since for migrated
@@ -158,12 +155,13 @@ static void wb_sids2xids_lookupsids_done(struct tevent_req *subreq)
subreq, struct tevent_req);
struct wb_sids2xids_state *state = tevent_req_data(
req, struct wb_sids2xids_state);
+ struct lsa_RefDomainList *domains = NULL;
+ struct lsa_TransNameArray *names = NULL;
struct winbindd_child *child;
NTSTATUS status;
int i;
- status = wb_lookupsids_recv(subreq, state, &state->domains,
- &state->names);
+ status = wb_lookupsids_recv(subreq, state, &domains, &names);
TALLOC_FREE(subreq);
if (tevent_req_nterror(req, status)) {
return;
@@ -184,13 +182,13 @@ static void wb_sids2xids_lookupsids_done(struct tevent_req *subreq)
for (i=0; i<state->num_non_cached; i++) {
struct dom_sid dom_sid;
struct lsa_DomainInfo *info;
- struct lsa_TranslatedName *n = &state->names->names[i];
+ struct lsa_TranslatedName *n = &names->names[i];
struct wbint_TransID *t = &state->ids.ids[i];
sid_copy(&dom_sid, &state->non_cached[i]);
sid_split_rid(&dom_sid, &t->rid);
- info = &state->domains->domains[n->sid_index];
+ info = &domains->domains[n->sid_index];
t->type = lsa_SidType_to_id_type(n->sid_type);
t->domain_index = init_lsa_ref_domain_list(state,
state->idmap_doms,
@@ -200,6 +198,9 @@ static void wb_sids2xids_lookupsids_done(struct tevent_req *subreq)
t->xid.type = t->type;
}
+ TALLOC_FREE(names);
+ TALLOC_FREE(domains);
+
child = idmap_child();
subreq = dcerpc_wbint_Sids2UnixIDs_send(