summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Reichl <preichl@redhat.com>2016-01-13 09:07:39 -0500
committerLukas Slebodnik <lslebodn@redhat.com>2016-01-20 18:11:02 +0100
commit7db89d44b5582a0cb0a61a7aa42a2fac7ca9408f (patch)
treeeafca41b4039dec612d383d6862abb26237f221c
parente9c42ec738c213bd5f351567c20d404a280b32d0 (diff)
downloadsssd-7db89d44b5582a0cb0a61a7aa42a2fac7ca9408f.tar.gz
sssd-7db89d44b5582a0cb0a61a7aa42a2fac7ca9408f.tar.xz
sssd-7db89d44b5582a0cb0a61a7aa42a2fac7ca9408f.zip
IDMAP: Fix computing max id for slice range
Max value of id mapping range was 1 unit too high. Resolves: https://fedorahosted.org/sssd/ticket/2922 Reviewed-by: Sumit Bose <sbose@redhat.com>
-rw-r--r--src/lib/idmap/sss_idmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/idmap/sss_idmap.c b/src/lib/idmap/sss_idmap.c
index 4c4531205..b5457f92d 100644
--- a/src/lib/idmap/sss_idmap.c
+++ b/src/lib/idmap/sss_idmap.c
@@ -336,7 +336,7 @@ enum idmap_error_code sss_idmap_calculate_range(struct sss_idmap_ctx *ctx,
}
min = (rangesize * new_slice) + idmap_lower;
- max = min + rangesize;
+ max = min + rangesize - 1;
/* Verify that this slice is not already in use */
do {
for (dom = ctx->idmap_domain_info; dom != NULL; dom = dom->next) {
@@ -353,7 +353,7 @@ enum idmap_error_code sss_idmap_calculate_range(struct sss_idmap_ctx *ctx,
}
min = (rangesize * new_slice) + idmap_lower;
- max = min + rangesize;
+ max = min + rangesize - 1;
break;
}
}
@@ -371,7 +371,7 @@ enum idmap_error_code sss_idmap_calculate_range(struct sss_idmap_ctx *ctx,
}
_range->min = (rangesize * new_slice) + idmap_lower;
- _range->max = _range->min + rangesize;
+ _range->max = _range->min + rangesize - 1;
if (slice_num) {
*slice_num = new_slice;