diff options
author | Michael Adam <obnox@samba.org> | 2013-07-26 11:31:41 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-07-29 12:53:54 +0200 |
commit | f62219e71af69ec8b331500b75fd5fd77d51a636 (patch) | |
tree | 0f89e741f49b98167adbc379eee7c54b15d2951e /source3/winbindd | |
parent | 45f5ea0b57952b7050279ae10402fa7d570f1c93 (diff) | |
download | samba-f62219e71af69ec8b331500b75fd5fd77d51a636.tar.gz samba-f62219e71af69ec8b331500b75fd5fd77d51a636.tar.bz2 samba-f62219e71af69ec8b331500b75fd5fd77d51a636.zip |
s3:winbind: fix gid counting and error handling in the getgroups implementation
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/winbindd')
-rw-r--r-- | source3/winbindd/winbindd_getgroups.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source3/winbindd/winbindd_getgroups.c b/source3/winbindd/winbindd_getgroups.c index 1774901903..bed8877cab 100644 --- a/source3/winbindd/winbindd_getgroups.c +++ b/source3/winbindd/winbindd_getgroups.c @@ -156,18 +156,22 @@ static void winbindd_getgroups_sid2gid_done(struct tevent_req *subreq) status = wb_sids2xids_recv(subreq, &xid); TALLOC_FREE(subreq); + if (NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED) || + NT_STATUS_EQUAL(status, STATUS_SOME_UNMAPPED)) + { + status = NT_STATUS_OK; + } + if (tevent_req_nterror(req, status)) { + return; + } + if (xid.type == ID_TYPE_GID || xid.type == ID_TYPE_BOTH) { state->gids[state->num_gids] = (gid_t)xid.id; + state->num_gids += 1; } else { state->gids[state->num_gids] = (uid_t)-1; } - /* - * In case of failure, just continue with the next gid - */ - if (NT_STATUS_IS_OK(status)) { - state->num_gids += 1; - } state->next_sid += 1; if (state->next_sid >= state->num_sids) { |