* lib/subordinateio.c: Fix handling of boundaries.
* libmisc/find_new_sub_uids.c: Likewise.
* libmisc/find_new_sub_gids.c: Likewise.
+2013-08-13 Nicolas François <nicolas.francois@centraliens.net>
+
+ * lib/subordinateio.c: Fix handling of boundaries.
+ * libmisc/find_new_sub_uids.c: Likewise.
+ * libmisc/find_new_sub_gids.c: Likewise.
+
2013-08-12 Nicolas François <nicolas.francois@centraliens.net>
* lib/subordinateio.c: Fix removal of ranges. The database needs
unsigned long low, high;
/* When given invalid parameters fail */
- if ((count == 0) || (max <= min))
+ if ((count == 0) || (max < min))
goto fail;
/* Sort by range then by owner */
high = max;
/* Is the hole before this range large enough? */
- if ((high > low) && (((high - low) + 1) >= count))
+ if ((high > low) && ((high - low) >= count))
return low;
/* Compute the low end of the next hole */
max = getdef_ulong ("SUB_GID_MAX", 600100000UL);
count = getdef_ulong ("SUB_GID_COUNT", 10000);
- if (min >= max || count >= max || (min + count) >= max) {
+ if (min > max || count >= max || (min + count - 1) > max) {
(void) fprintf (stderr,
_("%s: Invalid configuration: SUB_GID_MIN (%lu),"
" SUB_GID_MAX (%lu), SUB_GID_COUNT (%lu)\n"),
max = getdef_ulong ("SUB_UID_MAX", 600100000UL);
count = getdef_ulong ("SUB_UID_COUNT", 10000);
- if (min >= max || count >= max || (min + count) >= max) {
+ if (min > max || count >= max || (min + count - 1) > max) {
(void) fprintf (stderr,
_("%s: Invalid configuration: SUB_UID_MIN (%lu),"
" SUB_UID_MAX (%lu), SUB_UID_COUNT (%lu)\n"),