s3:idmap_ldap: use ranges from idmap domain in idmap_ldap_allocate_id()
authorMichael Adam <obnox@samba.org>
Thu, 17 Jun 2010 17:03:12 +0000 (19:03 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 23 Jun 2010 10:22:18 +0000 (12:22 +0200)
Second step in removing the idmap range from the idmap_ldap_alloc_context.

source3/winbindd/idmap_ldap.c

index 51cc65f7e80462a8d43a8585640de7a1b4a44b0a..05272cf67d355023c609d4787e11af4b441de516 100644 (file)
@@ -323,7 +323,8 @@ static NTSTATUS idmap_ldap_alloc_init(struct idmap_domain *dom,
  Allocate a new uid or gid
 ********************************/
 
-static NTSTATUS idmap_ldap_allocate_id(struct unixid *xid)
+static NTSTATUS idmap_ldap_allocate_id(struct idmap_domain *dom,
+                                      struct unixid *xid)
 {
        TALLOC_CTX *ctx;
        NTSTATUS ret = NT_STATUS_UNSUCCESSFUL;
@@ -426,17 +427,17 @@ static NTSTATUS idmap_ldap_allocate_id(struct unixid *xid)
 
        switch (xid->type) {
        case ID_TYPE_UID:
-               if (xid->id > idmap_alloc_ldap->high_uid) {
+               if (xid->id > dom->high_id) {
                        DEBUG(0,("Cannot allocate uid above %lu!\n",
-                                (unsigned long)idmap_alloc_ldap->high_uid));
+                                (unsigned long)dom->high_id));
                        goto done;
                }
                break;
 
        case ID_TYPE_GID:
-               if (xid->id > idmap_alloc_ldap->high_gid) {
+               if (xid->id > dom->high_id) {
                        DEBUG(0,("Cannot allocate gid above %lu!\n",
-                                (unsigned long)idmap_alloc_ldap->high_uid));
+                                (unsigned long)dom->high_id));
                        goto done;
                }
                break;