From fae75645950a766944e76cbd1d77811227fa50d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= Date: Thu, 30 May 2019 06:08:11 +0200 Subject: [PATCH] user.eclass: Die if no free UID/GID is found MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- eclass/user.eclass | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eclass/user.eclass b/eclass/user.eclass index 92a07bb6b41b..8afbc101fac3 100644 --- a/eclass/user.eclass +++ b/eclass/user.eclass @@ -135,6 +135,7 @@ enewuser() { for ((euid = 101; euid <= 999; euid++)); do [[ -z $(egetent passwd ${euid}) ]] && break done + [[ ${euid} -le 999 ]] || die "${FUNCNAME}: no free UID found" fi opts+=( -u ${euid} ) einfo " - Userid: ${euid}" @@ -307,6 +308,7 @@ enewgroup() { for ((egid = 101; egid <= 999; egid++)) ; do [[ -z $(egetent group ${egid}) ]] && break done + [[ ${egid} -le 999 ]] || die "${FUNCNAME}: no free GID found" fi } -- 2.26.2