acct-group.eclass: Do not enforce GID unless requested
authorMichał Górny <mgorny@gentoo.org>
Mon, 8 Jul 2019 13:06:35 +0000 (15:06 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 9 Jul 2019 13:29:40 +0000 (15:29 +0200)
Correct the enewgroup call not to enforce specified GID unless
ACCT_GROUP_ENFORCE_ID is set.

Reported-by: Toralf Förster <toralf@gentoo.org>
Tested-by: Marek Szuba <marecki@gentoo.org>
Closes: https://bugs.gentoo.org/689100
Signed-off-by: Michał Górny <mgorny@gentoo.org>
eclass/acct-group.eclass

index ab9095979ab7b118e157fcc200f8557bda1bae3d..9eab00db690fbd279d2c751df1dea2d67a0f6086 100644 (file)
@@ -117,7 +117,8 @@ acct-group_pkg_pretend() {
 acct-group_pkg_preinst() {
        debug-print-function ${FUNCNAME} "${@}"
 
-       enewgroup -F "${ACCT_GROUP_NAME}" "${ACCT_GROUP_ID}"
+       enewgroup ${ACCT_GROUP_ENFORCE_ID:+-F} "${ACCT_GROUP_NAME}" \
+               "${ACCT_GROUP_ID}"
 }
 
 fi