From a273ed89dbb42081925f95b6d5490018c7cad110 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 27 Feb 2023 10:01:16 +0100 Subject: s3:utils: Check if the autorid rangesize is a multiple of the range We also have this in our documentation. Signed-off-by: Andreas Schneider Reviewed-by: Guenther Deschner --- source3/utils/testparm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c index b975188094c..ce624c9d0cd 100644 --- a/source3/utils/testparm.c +++ b/source3/utils/testparm.c @@ -192,6 +192,17 @@ static bool do_idmap_check(void) uint32_t maxranges = (c->high - c->low + 1) / rangesize; + if (((c->high - c->low + 1) % rangesize) != 0) { + fprintf(stderr, + "WARNING: The idmap autorid range " + "[%u-%u] SHOULD to be a multiple of " + "the rangesize [%u]!" + "\n\n", + c->low, + c->high, + rangesize); + } + if (maxranges < 2) { fprintf(stderr, "ERROR: The idmap autorid range " -- cgit v1.2.1