From: Volker Lendecke Date: Thu, 2 Mar 2017 14:14:51 +0000 (+0100) Subject: Re-enable token groups fallback X-Git-Tag: tdb-1.3.13~645 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6296c32668af60118ae7059772d2f70e58e1f0d1;p=thirdparty%2Fsamba.git Re-enable token groups fallback BUG: https://bugzilla.samba.org/show_bug.cgi?id=12612 Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Mon Mar 6 19:18:31 CET 2017 on sn-devel-144 --- diff --git a/source3/winbindd/wb_gettoken.c b/source3/winbindd/wb_gettoken.c index 07c7fc79a31..a393b0f09e7 100644 --- a/source3/winbindd/wb_gettoken.c +++ b/source3/winbindd/wb_gettoken.c @@ -38,6 +38,7 @@ static NTSTATUS wb_add_rids_to_sids(TALLOC_CTX *mem_ctx, int num_rids, uint32_t *rids); static void wb_gettoken_gotuser(struct tevent_req *subreq); +static void wb_gettoken_gotgroups(struct tevent_req *subreq); static void wb_gettoken_gotlocalgroups(struct tevent_req *subreq); static void wb_gettoken_gotbuiltins(struct tevent_req *subreq); @@ -71,10 +72,7 @@ static void wb_gettoken_gotuser(struct tevent_req *subreq) subreq, struct tevent_req); struct wb_gettoken_state *state = tevent_req_data( req, struct wb_gettoken_state); - struct winbindd_domain *domain; struct wbint_userinfo *info; - uint32_t i, num_groups; - struct dom_sid *groups; NTSTATUS status; status = wb_queryuser_recv(subreq, state, &info); @@ -92,11 +90,27 @@ static void wb_gettoken_gotuser(struct tevent_req *subreq) sid_copy(&state->sids[0], &info->user_sid); sid_copy(&state->sids[1], &info->group_sid); - status = lookup_usergroups_cached( - state, &info->user_sid, &num_groups, &groups); + subreq = wb_lookupusergroups_send(state, state->ev, &info->user_sid); + if (tevent_req_nomem(subreq, req)) { + return; + } + tevent_req_set_callback(subreq, wb_gettoken_gotgroups, req); +} + +static void wb_gettoken_gotgroups(struct tevent_req *subreq) +{ + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + struct wb_gettoken_state *state = tevent_req_data( + req, struct wb_gettoken_state); + int i, num_groups; + struct dom_sid *groups; + struct winbindd_domain *domain; + NTSTATUS status; + + status = wb_lookupusergroups_recv(subreq, state, &num_groups, &groups); + TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - DBG_DEBUG("lookup_usergroups_cached failed (%s), not doing " - "supplementary group lookups\n", nt_errstr(status)); tevent_req_done(req); return; }