summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2012-11-23 16:44:41 +0100
committerStefan Metzmacher <metze@samba.org>2012-12-03 08:48:25 +0100
commiteb0fca9b7b06a2aebce0da3031b1af313f0c8081 (patch)
tree0d586e1c9fab8df801af95a05e650e054c8f4b56
parent55ea9210e9b9cbb5a8b4633f492920af7eda77ab (diff)
downloadsamba-eb0fca9b7b06a2aebce0da3031b1af313f0c8081.tar.gz
samba-eb0fca9b7b06a2aebce0da3031b1af313f0c8081.tar.bz2
samba-eb0fca9b7b06a2aebce0da3031b1af313f0c8081.zip
s3:winbindd: change wb_getgrsid 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/wb_getgrsid.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/source3/winbindd/wb_getgrsid.c b/source3/winbindd/wb_getgrsid.c
index 7d7e56a5ca..2097539e29 100644
--- a/source3/winbindd/wb_getgrsid.c
+++ b/source3/winbindd/wb_getgrsid.c
@@ -97,7 +97,7 @@ static void wb_getgrsid_lookupsid_done(struct tevent_req *subreq)
return;
}
- subreq = wb_sid2gid_send(state, state->ev, &state->sid);
+ subreq = wb_sids2xids_send(state, state->ev, &state->sid, 1);
if (tevent_req_nomem(subreq, req)) {
return;
}
@@ -111,12 +111,27 @@ static void wb_getgrsid_sid2gid_done(struct tevent_req *subreq)
struct wb_getgrsid_state *state = tevent_req_data(
req, struct wb_getgrsid_state);
NTSTATUS status;
+ struct unixid xid;
- status = wb_sid2gid_recv(subreq, &state->gid);
+ status = wb_sids2xids_recv(subreq, &xid);
TALLOC_FREE(subreq);
if (tevent_req_nterror(req, status)) {
return;
}
+
+ /*
+ * We are filtering further down in sids2xids, but that filtering
+ * depends on the actual type of the sid handed in (as determined
+ * by lookupsids). Here we need to filter for the type of object
+ * actually requested, in this case uid.
+ */
+ if (!(xid.type == ID_TYPE_GID || xid.type == ID_TYPE_BOTH)) {
+ tevent_req_nterror(req, NT_STATUS_NONE_MAPPED);
+ return;
+ }
+
+ state->gid = (gid_t)xid.id;
+
subreq = wb_group_members_send(state, state->ev, &state->sid,
state->type, state->max_nesting);
if (tevent_req_nomem(subreq, req)) {