s3:idmap_ldap: add idmap_ldap_get_new_id() to allocate a new id given a domain
[nivanova/samba-autobuild/.git] / source3 / winbindd / idmap_ldap.c
index c7bc80f98a813c286e77c55397b7925f4e1a6a48..1079de1e1d7f63a94a9cb5ef64d29d0962abbb34 100644 (file)
@@ -497,6 +497,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
 **********************************************************************/