From 0df8988c086fb4d4ea4f683f3a2d399fd6e59f82 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 11 Apr 2014 21:31:48 +0200 Subject: [PATCH] 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 Reviewed-by: Stefan Metzmacher --- source3/include/idmap_autorid_tdb.h | 1 + source3/winbindd/idmap_autorid_tdb.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/source3/include/idmap_autorid_tdb.h b/source3/include/idmap_autorid_tdb.h index 2d2d01ade34..52bee565199 100644 --- a/source3/include/idmap_autorid_tdb.h +++ b/source3/include/idmap_autorid_tdb.h @@ -49,6 +49,7 @@ struct autorid_range_config { uint32_t rangenum; uint32_t domain_range_index; uint32_t low_id; + uint32_t high_id; }; /** diff --git a/source3/winbindd/idmap_autorid_tdb.c b/source3/winbindd/idmap_autorid_tdb.c index ebce89cfabd..89c3ad7b9a3 100644 --- a/source3/winbindd/idmap_autorid_tdb.c +++ b/source3/winbindd/idmap_autorid_tdb.c @@ -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: -- 2.11.4.GIT