s3:idmap: use allocate_id() from the idmap_methods in idmap_allocate_unixid()
authorMichael Adam <obnox@samba.org>
Tue, 22 Jun 2010 12:37:47 +0000 (14:37 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 23 Jun 2010 09:10:28 +0000 (11:10 +0200)
source3/winbindd/idmap.c

index 9edcb670dec63f3e2266906c2fbf97ce358ab226..58cc3a8abce27b5e0dbeebb9fc350ea1ea0172aa 100644 (file)
@@ -441,8 +441,6 @@ void idmap_close(void)
 static NTSTATUS idmap_allocate_unixid(struct unixid *id)
 {
        struct idmap_domain *dom;
-       struct id_map *maps[2];
-       struct id_map map;
        NTSTATUS ret;
 
        dom = idmap_find_domain(NULL);
@@ -451,22 +449,13 @@ static NTSTATUS idmap_allocate_unixid(struct unixid *id)
                return NT_STATUS_UNSUCCESSFUL;
        }
 
-       map.sid = NULL;
-       map.status = ID_UNKNOWN;
-       map.xid = *id;
-
-       maps[0] = &map;
-       maps[1] = NULL;
-
-       ret = dom->methods->sids_to_unixids(dom, maps);
-
-       if (!NT_STATUS_IS_OK(ret)) {
-               return ret;
+       if (dom->methods->allocate_id == NULL) {
+               return NT_STATUS_NOT_IMPLEMENTED;
        }
 
-       *id = map.xid;
+       ret = dom->methods->allocate_id(dom, id);
 
-       return NT_STATUS_OK;
+       return ret;
 }