From c5be90a901c4ca3fb6d54fc467dab61d998e9ac7 Mon Sep 17 00:00:00 2001 From: Cove Schneider Date: Wed, 19 Jun 2013 18:27:08 -0700 Subject: [PATCH] Fix bug #9960: check if a new RID pool has already been alocated before allocating a new RID pool when half of the current pool is used up. --- source4/dsdb/samdb/ldb_modules/ridalloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source4/dsdb/samdb/ldb_modules/ridalloc.c b/source4/dsdb/samdb/ldb_modules/ridalloc.c index 73ecb03..7bac650 100644 --- a/source4/dsdb/samdb/ldb_modules/ridalloc.c +++ b/source4/dsdb/samdb/ldb_modules/ridalloc.c @@ -606,7 +606,8 @@ int ridalloc_allocate_rid(struct ldb_module *module, uint32_t *rid, struct ldb_r /* * if we are half-exhausted then try to get a new pool. */ - if (nridset.next_rid > (prev_pool_hi + prev_pool_lo)/2) { + if (nridset.next_rid > (prev_pool_hi + prev_pool_lo)/2 && + nridset.alloc_pool == nridset.prev_pool) { /* * if we are the RID Manager, * we can get a new pool localy. -- 1.8.2.3