static NTSTATUS idmap_allocate_unixid(struct unixid *id)
{
- struct idmap_alloc_context *ctx;
- NTSTATUS ret;
+ struct idmap_domain *dom;
+ struct id_map *maps[2];
+ struct id_map map;
- if (!NT_STATUS_IS_OK(ret = idmap_alloc_init(&ctx))) {
- return ret;
+ dom = idmap_find_domain(NULL);
+
+ if (dom == NULL) {
+ return NT_STATUS_UNSUCCESSFUL;
}
- return ctx->methods->allocate_id(id);
+ map.sid = NULL;
+ map.status = ID_UNKNOWN;
+ map.xid = *id;
+
+ maps[0] = ↦
+ maps[1] = NULL;
+
+ return dom->methods->sids_to_unixids(dom, maps);
}