From 9370ca73534408e928474c4a808eb04051e435d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= Date: Fri, 31 Jan 2020 15:56:48 +0100 Subject: [PATCH] user.eclass: enewgroup, allow -1 as gid MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Allow using '-1' to specify 'next free GID' for enewgroup. While technically this can already be specified by omitting gid, allowing -1 improves consistency with enewuser. Closes: https://bugs.gentoo.org/707508 Signed-off-by: Michał Górny --- eclass/user.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/user.eclass b/eclass/user.eclass index a33915e21192..b70698356a3a 100644 --- a/eclass/user.eclass +++ b/eclass/user.eclass @@ -252,7 +252,7 @@ enewgroup() { # handle gid local egid=$1; shift - if [[ ! -z ${egid} ]] ; then + if [[ -n ${egid} && ${egid} != -1 ]] ; then if [[ ${egid} -gt 0 ]] ; then if [[ -n $(egetent group ${egid}) ]] ; then [[ -n ${force_gid} ]] && die "${FUNCNAME}: GID ${egid} already taken" -- 2.26.2