Skip to content

Commit

Permalink
IDMAP: Fix computing max id for slice range
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit 7db89d4)
  • Loading branch information
preichl authored and Lukas Slebodnik committed Jan 20, 2016
1 parent 58e388c commit 645933b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/idmap/sss_idmap.c
Expand Up @@ -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) {
Expand All @@ -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;
}
}
Expand All @@ -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;
Expand Down

0 comments on commit 645933b

Please sign in to comment.