1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3:idmap_ldap: use ranges from idmap domain in idmap_ldap_allocate_id()

Second step in removing the idmap range from the idmap_ldap_alloc_context.
This commit is contained in:
Michael Adam 2010-06-17 19:03:12 +02:00
parent 5518bcb840
commit 3f39921e7e

View File

@ -325,7 +325,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;
@ -424,17 +425,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;