Previously, if either of the rIDPreviousAllocation and rIDNextRID
attributes were not present in a RID Set, the first RID in
rIDAllocationPool was skipped over when determining their values.
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
if prev_pool == uint64_max or next_rid == uint32_max:
prev_pool = alloc_pool
next_rid = prev_pool & uint32_max
-
- next_rid += 1
+ else:
+ next_rid += 1
# Now check if our current pool is still usable
prev_pool_lo = prev_pool & uint32_max
"rIDAllocationPool"))
self.samdb.modify(msg)
- # Ensure that next_free_rid() returns the start of the next pool
- # plus one.
+ # Ensure that next_free_rid() returns the start of the next pool.
next_free_rid3 = self.samdb.next_free_rid()
- self.assertEqual(next_lo + 1, next_free_rid3)
+ self.assertEqual(next_lo, next_free_rid3)
# Check the result of allocate_rid() matches.
rid = self.samdb.allocate_rid()
nridset.next_rid == UINT32_MAX) {
nridset.prev_pool = nridset.alloc_pool;
nridset.next_rid = nridset.prev_pool & 0xFFFFFFFF;
+ } else {
+ nridset.next_rid += 1;
}
/*
* Now check if our current pool is still usable
*/
- nridset.next_rid += 1;
prev_pool_lo = nridset.prev_pool & 0xFFFFFFFF;
prev_pool_hi = nridset.prev_pool >> 32;
if (nridset.next_rid > prev_pool_hi) {