s3:winbind:idmap: use sids_to_unixids() with a NULL sid instead of allocate_id
authorMichael Adam <obnox@samba.org>
Sun, 30 May 2010 20:24:19 +0000 (22:24 +0200)
committerMichael Adam <obnox@samba.org>
Mon, 31 May 2010 15:34:03 +0000 (17:34 +0200)
source3/winbindd/idmap.c

index c58c5c255201fefc63261df20ce72f3ad59d6dd9..cc7ca629fcbfbe69c2dfa0fb3c200fe63ca16aac 100644 (file)
@@ -607,14 +607,24 @@ fail:
 
 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] = &map;
+       maps[1] = NULL;
+
+       return dom->methods->sids_to_unixids(dom, maps);
 }