mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
winbind: Use xids2sids in getgrgid
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
b0f6adf351
commit
e2dda192e7
@ -19,10 +19,12 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include "winbindd.h"
|
||||
#include "libcli/security/dom_sid.h"
|
||||
|
||||
struct winbindd_getgrgid_state {
|
||||
struct tevent_context *ev;
|
||||
struct dom_sid sid;
|
||||
struct unixid xid;
|
||||
struct dom_sid *sid;
|
||||
const char *domname;
|
||||
const char *name;
|
||||
gid_t gid;
|
||||
@ -49,7 +51,10 @@ struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
|
||||
|
||||
DEBUG(3, ("getgrgid %d\n", (int)request->data.gid));
|
||||
|
||||
subreq = wb_gid2sid_send(state, ev, request->data.gid);
|
||||
state->xid = (struct unixid) {
|
||||
.id = request->data.uid, .type = ID_TYPE_GID };
|
||||
|
||||
subreq = wb_xids2sids_send(state, ev, &state->xid, 1);
|
||||
if (tevent_req_nomem(subreq, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
@ -66,13 +71,13 @@ static void winbindd_getgrgid_gid2sid_done(struct tevent_req *subreq)
|
||||
req, struct winbindd_getgrgid_state);
|
||||
NTSTATUS status;
|
||||
|
||||
status = wb_gid2sid_recv(subreq, &state->sid);
|
||||
status = wb_xids2sids_recv(subreq, state, &state->sid);
|
||||
TALLOC_FREE(subreq);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return;
|
||||
}
|
||||
|
||||
subreq = wb_getgrsid_send(state, state->ev, &state->sid,
|
||||
subreq = wb_getgrsid_send(state, state->ev, state->sid,
|
||||
lp_winbind_expand_groups());
|
||||
if (tevent_req_nomem(subreq, req)) {
|
||||
return;
|
||||
@ -108,7 +113,7 @@ NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
|
||||
|
||||
if (tevent_req_is_nterror(req, &status)) {
|
||||
DEBUG(5, ("Could not convert sid %s: %s\n",
|
||||
sid_string_dbg(&state->sid), nt_errstr(status)));
|
||||
sid_string_dbg(state->sid), nt_errstr(status)));
|
||||
return status;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user