summaryrefslogtreecommitdiff
path: root/source4/winbind/wb_cmd_usersids.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/winbind/wb_cmd_usersids.c')
-rw-r--r--source4/winbind/wb_cmd_usersids.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/source4/winbind/wb_cmd_usersids.c b/source4/winbind/wb_cmd_usersids.c
index b414cf6313..da4cb80c7b 100644
--- a/source4/winbind/wb_cmd_usersids.c
+++ b/source4/winbind/wb_cmd_usersids.c
@@ -34,20 +34,20 @@ struct cmd_usersids_state {
struct composite_context *ctx;
struct wbsrv_service *service;
struct dom_sid *user_sid;
- int num_domgroups;
+ uint32_t num_domgroups;
struct dom_sid **domgroups;
struct lsa_SidArray lsa_sids;
struct samr_Ids rids;
struct samr_GetAliasMembership r;
- int num_sids;
+ uint32_t num_sids;
struct dom_sid **sids;
};
static void usersids_recv_domgroups(struct composite_context *ctx);
static void usersids_recv_domain(struct composite_context *ctx);
-static void usersids_recv_aliases(struct rpc_request *req);
+static void usersids_recv_aliases(struct tevent_req *subreq);
struct composite_context *wb_cmd_usersids_send(TALLOC_CTX *mem_ctx,
struct wbsrv_service *service,
@@ -102,9 +102,9 @@ static void usersids_recv_domain(struct composite_context *ctx)
struct cmd_usersids_state *state =
talloc_get_type(ctx->async.private_data,
struct cmd_usersids_state);
- struct rpc_request *req;
+ struct tevent_req *subreq;
struct wbsrv_domain *domain;
- int i;
+ uint32_t i;
state->ctx->status = wb_sid2domain_recv(ctx, &domain);
if (!composite_is_ok(state->ctx)) return;
@@ -126,19 +126,23 @@ static void usersids_recv_domain(struct composite_context *ctx)
state->r.in.sids = &state->lsa_sids;
state->r.out.rids = &state->rids;
- req = dcerpc_samr_GetAliasMembership_send(domain->libnet_ctx->samr.pipe, state,
- &state->r);
- composite_continue_rpc(state->ctx, req, usersids_recv_aliases, state);
+ subreq = dcerpc_samr_GetAliasMembership_r_send(state,
+ state->ctx->event_ctx,
+ domain->libnet_ctx->samr.pipe->binding_handle,
+ &state->r);
+ if (composite_nomem(subreq, state->ctx)) return;
+ tevent_req_set_callback(subreq, usersids_recv_aliases, state);
}
-static void usersids_recv_aliases(struct rpc_request *req)
+static void usersids_recv_aliases(struct tevent_req *subreq)
{
struct cmd_usersids_state *state =
- talloc_get_type(req->async.private_data,
- struct cmd_usersids_state);
- int i;
+ tevent_req_callback_data(subreq,
+ struct cmd_usersids_state);
+ uint32_t i;
- state->ctx->status = dcerpc_ndr_request_recv(req);
+ state->ctx->status = dcerpc_samr_GetAliasMembership_r_recv(subreq, state);
+ TALLOC_FREE(subreq);
if (!composite_is_ok(state->ctx)) return;
state->ctx->status = state->r.out.result;
if (!composite_is_ok(state->ctx)) return;
@@ -168,7 +172,7 @@ static void usersids_recv_aliases(struct rpc_request *req)
NTSTATUS wb_cmd_usersids_recv(struct composite_context *ctx,
TALLOC_CTX *mem_ctx,
- int *num_sids, struct dom_sid ***sids)
+ uint32_t *num_sids, struct dom_sid ***sids)
{
NTSTATUS status = composite_wait(ctx);
if (NT_STATUS_IS_OK(status)) {
@@ -184,7 +188,7 @@ NTSTATUS wb_cmd_usersids_recv(struct composite_context *ctx,
NTSTATUS wb_cmd_usersids(TALLOC_CTX *mem_ctx, struct wbsrv_service *service,
const struct dom_sid *sid,
- int *num_sids, struct dom_sid ***sids)
+ uint32_t *num_sids, struct dom_sid ***sids)
{
struct composite_context *c =
wb_cmd_usersids_send(mem_ctx, service, sid);