Fix handling of boundaries.

* lib/subordinateio.c: Fix handling of boundaries.
	* libmisc/find_new_sub_uids.c: Likewise.
	* libmisc/find_new_sub_gids.c: Likewise.
This commit is contained in:
Nicolas François
2013-08-13 00:11:24 +02:00
parent d9d1bb4acb
commit bfbd83239e
4 changed files with 10 additions and 4 deletions

View File

@ -60,7 +60,7 @@ int find_new_sub_uids (const char *owner,
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"),