From 5e746768c8adf77551d7904f8534372f88475675 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 23 Nov 2012 16:54:36 +0100 Subject: s3:winbindd: change winbindd_getgroups to use wb_sids2xids instead of wb_sid2gid Signed-off-by: Michael Adam Reviewed-by: Stefan Metzmacher --- source3/winbindd/winbindd_getgroups.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'source3/winbindd/winbindd_getgroups.c') diff --git a/source3/winbindd/winbindd_getgroups.c b/source3/winbindd/winbindd_getgroups.c index a42986f15f..1774901903 100644 --- a/source3/winbindd/winbindd_getgroups.c +++ b/source3/winbindd/winbindd_getgroups.c @@ -134,8 +134,8 @@ static void winbindd_getgroups_gettoken_done(struct tevent_req *subreq) state->num_gids = 0; state->next_sid = 1; - subreq = wb_sid2gid_send(state, state->ev, - &state->sids[state->next_sid]); + subreq = wb_sids2xids_send(state, state->ev, + &state->sids[state->next_sid], 1); if (tevent_req_nomem(subreq, req)) { return; } @@ -149,9 +149,18 @@ static void winbindd_getgroups_sid2gid_done(struct tevent_req *subreq) struct winbindd_getgroups_state *state = tevent_req_data( req, struct winbindd_getgroups_state); NTSTATUS status; + struct unixid xid; - status = wb_sid2gid_recv(subreq, &state->gids[state->num_gids]); + xid.type = ID_TYPE_NOT_SPECIFIED; + xid.id = UINT32_MAX; + + status = wb_sids2xids_recv(subreq, &xid); TALLOC_FREE(subreq); + if (xid.type == ID_TYPE_GID || xid.type == ID_TYPE_BOTH) { + state->gids[state->num_gids] = (gid_t)xid.id; + } else { + state->gids[state->num_gids] = (uid_t)-1; + } /* * In case of failure, just continue with the next gid @@ -166,8 +175,8 @@ static void winbindd_getgroups_sid2gid_done(struct tevent_req *subreq) return; } - subreq = wb_sid2gid_send(state, state->ev, - &state->sids[state->next_sid]); + subreq = wb_sids2xids_send(state, state->ev, + &state->sids[state->next_sid], 1); if (tevent_req_nomem(subreq, req)) { return; } -- cgit