1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

autorid: add high_id to range config and fill it where we also fill range->low_id.

This corresponds to low_id for convenience and allows
for computations without going back to the global config.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Michael Adam 2014-04-11 21:31:48 +02:00
parent a1adc881cf
commit 0df8988c08
2 changed files with 3 additions and 0 deletions

View File

@ -49,6 +49,7 @@ struct autorid_range_config {
uint32_t rangenum;
uint32_t domain_range_index;
uint32_t low_id;
uint32_t high_id;
};
/**

View File

@ -258,6 +258,7 @@ static NTSTATUS idmap_autorid_addrange_action(struct db_context *db,
range->low_id = globalcfg->minvalue
+ range->rangenum * globalcfg->rangesize;
range->high_id = range->low_id + globalcfg->rangesize - 1;
ret = NT_STATUS_OK;
@ -339,6 +340,7 @@ static NTSTATUS idmap_autorid_getrange_int(struct db_context *db,
}
range->low_id = globalcfg->minvalue
+ range->rangenum * globalcfg->rangesize;
range->high_id = range->low_id + globalcfg->rangesize - 1;
TALLOC_FREE(globalcfg);
done: