s3:idmap_tdb: add idmap_tdb_get_new_id() to allocate a new id given a domain
authorMichael Adam <obnox@samba.org>
Wed, 16 Jun 2010 07:26:17 +0000 (09:26 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 23 Jun 2010 10:22:11 +0000 (12:22 +0200)
Currently this only works with the default domain, calling out
to idmap_tdb_allocate_id(). In the future this will be extended
to also work for non-default domains.

source3/winbindd/idmap_tdb.c

index 3767b02d9684b5a6d522c7d59fed505dda30ef0c..6f76097bf6b7cbeb8a67d286f420be221786bfdb 100644 (file)
@@ -499,6 +499,30 @@ static NTSTATUS idmap_tdb_allocate_id(struct unixid *xid)
        return status;
 }
 
+/**
+ * Allocate a new unix-ID.
+ * For now this is for the default idmap domain only.
+ * Should be extended later on.
+ */
+static NTSTATUS idmap_tdb_get_new_id(struct idmap_domain *dom,
+                                    struct unixid *id)
+{
+       NTSTATUS ret;
+
+       if (!strequal(dom->name, "*")) {
+               DEBUG(3, ("idmap_tdb_get_new_id: "
+                         "Refusing allocation of a new unixid for domain'%s'. "
+                         "Currently only supported for the default "
+                         "domain \"*\".\n",
+                          dom->name));
+               return NT_STATUS_NOT_IMPLEMENTED;
+       }
+
+       ret = idmap_tdb_allocate_id(id);
+
+       return ret;
+}
+
 /**********************************
  Close the alloc tdb 
 **********************************/