s3:idmap_ldap: add idmap_ldap_get_new_id() to allocate a new id given a domain
authorMichael Adam <obnox@samba.org>
Thu, 17 Jun 2010 18:18:27 +0000 (20:18 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 23 Jun 2010 10:22:20 +0000 (12:22 +0200)
Currently this only works with the default domain, calling out
to idmap_ldap_allocate_id(). In the future this will be extended
to also work for non-default domains.

source3/winbindd/idmap_ldap.c

index 067097376a015b66af0c75e5280a1de016adaebb..4a06a5ce72c6aaa7713eee39d63c50608053430e 100644 (file)
@@ -499,6 +499,31 @@ done:
        return ret;
 }
 
+/**
+ * Allocate a new unix-ID.
+ * For now this is for the default idmap domain only.
+ * Should be extended later on.
+ */
+static NTSTATUS idmap_ldap_get_new_id(struct idmap_domain *dom,
+                                     struct unixid *id)
+{
+       NTSTATUS ret;
+
+       if (!strequal(dom->name, "*")) {
+               DEBUG(3, ("idmap_ldap_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_ldap_allocate_id(dom, id);
+
+       return ret;
+}
+
+
 /**********************************************************************
  IDMAP MAPPING LDAP BACKEND
 **********************************************************************/