struct wb_fill_pwent_state *state = tevent_req_data(
req, struct wb_fill_pwent_state);
NTSTATUS status;
- struct unixid xid;
+ struct unixid xids[1];
- status = wb_sids2xids_recv(subreq, &xid);
+ status = wb_sids2xids_recv(subreq, xids, ARRAY_SIZE(xids));
TALLOC_FREE(subreq);
if (tevent_req_nterror(req, status)) {
return;
* by lookupsids). Here we need to filter for the type of object
* actually requested, in this case uid.
*/
- if (!(xid.type == ID_TYPE_UID || xid.type == ID_TYPE_BOTH)) {
+ if (!(xids[0].type == ID_TYPE_UID || xids[0].type == ID_TYPE_BOTH)) {
tevent_req_nterror(req, NT_STATUS_NONE_MAPPED);
return;
}
- state->pw->pw_uid = (uid_t)xid.id;
+ state->pw->pw_uid = (uid_t)xids[0].id;
subreq = wb_getgrsid_send(state, state->ev, &state->info->group_sid, 0);
if (tevent_req_nomem(subreq, req)) {
struct wb_getgrsid_state *state = tevent_req_data(
req, struct wb_getgrsid_state);
NTSTATUS status;
- struct unixid xid;
+ struct unixid xids[1];
- status = wb_sids2xids_recv(subreq, &xid);
+ status = wb_sids2xids_recv(subreq, xids, ARRAY_SIZE(xids));
TALLOC_FREE(subreq);
if (tevent_req_nterror(req, status)) {
return;
* 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)) {
+ if (!(xids[0].type == ID_TYPE_GID || xids[0].type == ID_TYPE_BOTH)) {
tevent_req_nterror(req, NT_STATUS_NONE_MAPPED);
return;
}
- state->gid = (gid_t)xid.id;
+ state->gid = (gid_t)xids[0].id;
if (state->type == SID_NAME_USER || state->type == SID_NAME_COMPUTER) {
/*
*/
const char *name;
- if (xid.type != ID_TYPE_BOTH) {
+ if (xids[0].type != ID_TYPE_BOTH) {
tevent_req_nterror(req, NT_STATUS_NO_SUCH_GROUP);
return;
}
}
NTSTATUS wb_sids2xids_recv(struct tevent_req *req,
- struct unixid *xids)
+ struct unixid xids[], uint32_t num_xids)
{
struct wb_sids2xids_state *state = tevent_req_data(
req, struct wb_sids2xids_state);
return status;
}
+ if (num_xids != state->num_sids) {
+ DEBUG(1, ("%s: Have %u xids, caller wants %u\n", __func__,
+ (unsigned)state->num_sids, num_xids));
+ return NT_STATUS_INTERNAL_ERROR;
+ }
+
num_non_cached = 0;
for (i=0; i<state->num_sids; i++) {
xids[i].id = UINT32_MAX;
}
- status = wb_sids2xids_recv(subreq, xids);
+ status = wb_sids2xids_recv(subreq, xids, state->num_sids);
TALLOC_FREE(subreq);
if (NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED) ||
NT_STATUS_EQUAL(status, STATUS_SOME_UNMAPPED))
const struct dom_sid *sids,
const uint32_t num_sids);
NTSTATUS wb_sids2xids_recv(struct tevent_req *req,
- struct unixid *xids);
+ struct unixid xids[], uint32_t num_xids);
struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct winbindd_cli_state *cli,
struct winbindd_sid_to_gid_state *state = tevent_req_data(
req, struct winbindd_sid_to_gid_state);
NTSTATUS status;
- struct unixid xid;
+ struct unixid xids[1];
- status = wb_sids2xids_recv(subreq, &xid);
+ status = wb_sids2xids_recv(subreq, xids, ARRAY_SIZE(xids));
TALLOC_FREE(subreq);
if (tevent_req_nterror(req, status)) {
return;
* by lookupsids). Here we need to filter for the type of object
* actually requested, in this case gid.
*/
- if (!(xid.type == ID_TYPE_GID || xid.type == ID_TYPE_BOTH)) {
+ if (!(xids[0].type == ID_TYPE_GID || xids[0].type == ID_TYPE_BOTH)) {
tevent_req_nterror(req, NT_STATUS_NONE_MAPPED);
return;
}
- state->gid = (gid_t)xid.id;
+ state->gid = (gid_t)xids[0].id;
tevent_req_done(req);
}
struct winbindd_sid_to_uid_state *state = tevent_req_data(
req, struct winbindd_sid_to_uid_state);
NTSTATUS status;
- struct unixid xid;
+ struct unixid xids[1];
- status = wb_sids2xids_recv(subreq, &xid);
+ status = wb_sids2xids_recv(subreq, xids, ARRAY_SIZE(xids));
TALLOC_FREE(subreq);
if (tevent_req_nterror(req, status)) {
return;
* by lookupsids). Here we need to filter for the type of object
* actually requested, in this case uid.
*/
- if (!(xid.type == ID_TYPE_UID || xid.type == ID_TYPE_BOTH)) {
+ if (!(xids[0].type == ID_TYPE_UID || xids[0].type == ID_TYPE_BOTH)) {
tevent_req_nterror(req, NT_STATUS_NONE_MAPPED);
return;
}
- state->uid = (uid_t)xid.id;
+ state->uid = (uid_t)xids[0].id;
tevent_req_done(req);
}
return;
}
- status = wb_sids2xids_recv(subreq, state->xids);
+ status = wb_sids2xids_recv(subreq, state->xids, state->num_sids);
TALLOC_FREE(subreq);
if (tevent_req_nterror(req, status)) {
return;