summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-01-31 15:56:48 +0100
committerMichał Górny <mgorny@gentoo.org>2020-02-26 11:28:27 +0100
commit9370ca73534408e928474c4a808eb04051e435d3 (patch)
tree03f7cb0fcaec532ff1c3b9a53e7fa0b4eea01918
parentuser.eclass: Use more verbose logging (diff)
downloadgentoo-9370ca73.tar.gz
gentoo-9370ca73.tar.bz2
gentoo-9370ca73.zip
user.eclass: enewgroup, allow -1 as gid
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 <mgorny@gentoo.org>
-rw-r--r--eclass/user.eclass2
1 files changed, 1 insertions, 1 deletions
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"