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>
# 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"