From: Alejandro Colomar Date: Sun, 15 Mar 2026 14:57:43 +0000 (+0100) Subject: lib/: find_new_sub_[ug]ids(): Remove redundant checks X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=e3fc731e2c8054784bf103f7439249aadaa2ad71;p=thirdparty%2Fshadow.git lib/: find_new_sub_[ug]ids(): Remove redundant checks find_free_range() already checks this, and does it better. Signed-off-by: Alejandro Colomar --- diff --git a/lib/find_new_sub_gids.c b/lib/find_new_sub_gids.c index f858c1c1c..b5304d980 100644 --- a/lib/find_new_sub_gids.c +++ b/lib/find_new_sub_gids.c @@ -38,11 +38,6 @@ int find_new_sub_gids (id_t *range_start, unsigned long *range_count) max = getdef_ulong ("SUB_GID_MAX", 600100000UL); count = getdef_ulong ("SUB_GID_COUNT", 65536); - if (min > max || count >= max || (min + count - 1) > max) { - errno = ERANGE; - return -1; - } - start = sub_gid_find_free_range(min, max, count); if (start == -1) return -1; diff --git a/lib/find_new_sub_uids.c b/lib/find_new_sub_uids.c index 02675b0f9..30e9c46c2 100644 --- a/lib/find_new_sub_uids.c +++ b/lib/find_new_sub_uids.c @@ -38,11 +38,6 @@ int find_new_sub_uids (id_t *range_start, unsigned long *range_count) max = getdef_ulong ("SUB_UID_MAX", 600100000UL); count = getdef_ulong ("SUB_UID_COUNT", 65536); - if (min > max || count >= max || (min + count - 1) > max) { - errno = ERANGE; - return -1; - } - start = sub_uid_find_free_range(min, max, count); if (start == -1) return -1;