From: Volker Lendecke Date: Tue, 3 Jan 2017 15:00:46 +0000 (+0000) Subject: winbind: Use wb_gettoken in getuserdomgroups X-Git-Tag: samba-4.6.0rc1~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13d7d46a80949e2f8abd77c7dfc9dc9dcc03ae97;p=thirdparty%2Fsamba.git winbind: Use wb_gettoken in getuserdomgroups This makes sure we return the same information regardless of which call into winbind is used Signed-off-by: Volker Lendecke Reviewed-by: Uri Simchoni Reviewed-by: Andreas Schneider --- diff --git a/source3/winbindd/winbindd_getuserdomgroups.c b/source3/winbindd/winbindd_getuserdomgroups.c index 55094bb99a2..24ec1ddc019 100644 --- a/source3/winbindd/winbindd_getuserdomgroups.c +++ b/source3/winbindd/winbindd_getuserdomgroups.c @@ -36,7 +36,6 @@ struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx, { struct tevent_req *req, *subreq; struct winbindd_getuserdomgroups_state *state; - struct winbindd_domain *domain; req = tevent_req_create(mem_ctx, &state, struct winbindd_getuserdomgroups_state); @@ -56,15 +55,7 @@ struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } - domain = find_domain_from_sid_noinit(&state->sid); - if (domain == NULL) { - DEBUG(1,("could not find domain entry for sid %s\n", - request->data.sid)); - tevent_req_nterror(req, NT_STATUS_NO_SUCH_DOMAIN); - return tevent_req_post(req, ev); - } - - subreq = wb_lookupusergroups_send(state, ev, domain, &state->sid); + subreq = wb_gettoken_send(state, ev, &state->sid, false); if (tevent_req_nomem(subreq, req)) { return tevent_req_post(req, ev); } @@ -80,8 +71,8 @@ static void winbindd_getuserdomgroups_done(struct tevent_req *subreq) req, struct winbindd_getuserdomgroups_state); NTSTATUS status; - status = wb_lookupusergroups_recv(subreq, state, &state->num_sids, - &state->sids); + status = wb_gettoken_recv(subreq, state, &state->num_sids, + &state->sids); TALLOC_FREE(subreq); if (tevent_req_nterror(req, status)) { return;