+static void winbindd_allocate_uid_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_idmap(allocate_uid)\n"));
+ request_error(state);
+ return;
+ }
+
+ if (r->out.result != WINBIND_STATUS_OK) {
+ DEBUG(5, ("set_idmap(allocate_uid) returned an error:0x%08X\n",
+ r->out.result));
+ request_error(state);
+ return;
+ }
+
+ if (r->out.rep->uid > UINT32_MAX) {
+ DEBUG(1, ("set_idmap(allocate_uid) returned a 64bit uid %llu\n",
+ (unsigned long long)r->out.rep->uid));
+ request_error(state);
+ return;
+ }
+
+ state->response.data.uid = r->out.rep->uid;
+ request_ok(state);
+}
+