From: Michael Adam Date: Fri, 26 Jul 2013 09:31:41 +0000 (+0200) Subject: s3:winbind: fix gid counting and error handling in the getgroups implementation X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=f62219e71af69ec8b331500b75fd5fd77d51a636;p=metze%2Fsamba%2Fwip.git s3:winbind: fix gid counting and error handling in the getgroups implementation Pair-Programmed-With: Stefan Metzmacher Signed-off-by: Michael Adam Signed-off-by: Stefan Metzmacher --- diff --git a/source3/winbindd/winbindd_getgroups.c b/source3/winbindd/winbindd_getgroups.c index 177490190331..bed8877cabdc 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) {