return;
}
-static void set_hwm_recv(void *private_data, bool success)
+static void winbindd_set_hwm_recv(TALLOC_CTX *mem_ctx, bool success,
+ struct winbindd_ndr_call *c,
+ void *private_data,
+ void *_cont,
+ void *_cont_private)
{
struct winbindd_cli_state *state =
talloc_get_type_abort(private_data, struct winbindd_cli_state);
+ struct winbind_set_idmap *r =
+ talloc_get_type_abort(c->ndr.r, struct winbind_set_idmap);
if (!success) {
- DEBUG(5, ("Could not set sid mapping\n"));
+ DEBUG(5, ("Could not set_idmap(set_hwm)\n"));
+ request_error(state);
+ return;
+ }
+
+ if (r->out.result != WINBIND_STATUS_OK) {
+ DEBUG(5, ("set_idmap(set_hwm) returned an error:0x%08X\n",
+ r->out.result));
request_error(state);
return;
}
void winbindd_set_hwm(struct winbindd_cli_state *state)
{
- struct unixid xid;
+ struct winbind_set_idmap *r = NULL;
DEBUG(3, ("[%5lu]: set hwm\n", (unsigned long)state->pid));
return;
}
- xid.id = state->request.data.dual_idmapset.id;
- xid.type = state->request.data.dual_idmapset.type;
+ r = TALLOC_P(state->mem_ctx, struct winbind_set_idmap);
+ if (!r) goto nomem;
+ r->in.level = TALLOC_P(r, enum winbind_set_idmap_level);
+ if (!r->in.level) goto nomem;
+
+ *r->in.level = WINBIND_SET_IDMAP_LEVEL_SET_HWM;
+ r->in.req.hwm.id = state->request.data.dual_idmapset.id;
+ r->in.req.hwm.type = state->request.data.dual_idmapset.type;
- winbindd_set_hwm_async(state->mem_ctx, &xid, set_hwm_recv, state);
+ do_async_ndr(state->mem_ctx, idmap_child(),
+ NDR_WINBIND_SET_IDMAP, r,
+ winbindd_set_hwm_recv, state,
+ NULL, NULL);
+ return;
+nomem:
+ request_error(state);
+ return;
}
/* Convert a uid to a sid */