diff options
author | Michael Adam <obnox@samba.org> | 2012-11-23 16:54:36 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-12-03 08:48:25 +0100 |
commit | 5e746768c8adf77551d7904f8534372f88475675 (patch) | |
tree | 03c4077a39afd182e61b5713bcf1131749782e55 | |
parent | eb0fca9b7b06a2aebce0da3031b1af313f0c8081 (diff) | |
download | samba-5e746768c8adf77551d7904f8534372f88475675.tar.gz samba-5e746768c8adf77551d7904f8534372f88475675.tar.bz2 samba-5e746768c8adf77551d7904f8534372f88475675.zip |
s3:winbindd: change winbindd_getgroups to use wb_sids2xids instead of wb_sid2gid
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | source3/winbindd/winbindd_getgroups.c | 19 |
1 files changed, 14 insertions, 5 deletions
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; } |