summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-04-11 21:31:48 +0200
committerMichael Adam <obnox@samba.org>2014-04-25 15:35:09 +0200
commit0df8988c086fb4d4ea4f683f3a2d399fd6e59f82 (patch)
tree3720521169fc133deefaa7124596f667074e3472
parenta1adc881cf28643d1936b43c51e9a8839fc914d1 (diff)
downloadsamba-0df8988c086fb4d4ea4f683f3a2d399fd6e59f82.tar.gz
samba-0df8988c086fb4d4ea4f683f3a2d399fd6e59f82.tar.xz
samba-0df8988c086fb4d4ea4f683f3a2d399fd6e59f82.zip
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>
-rw-r--r--source3/include/idmap_autorid_tdb.h1
-rw-r--r--source3/winbindd/idmap_autorid_tdb.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/source3/include/idmap_autorid_tdb.h b/source3/include/idmap_autorid_tdb.h
index 2d2d01ade3..52bee56519 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 ebce89cfab..89c3ad7b9a 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: