1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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>
This commit is contained in:
Volker Lendecke 2015-01-23 13:32:45 +00:00 committed by Jeremy Allison
parent c6577f3043
commit 200d0bc3a8

View File

@ -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(