acct-user.eclass: Do not enforce UID unless requested
authorMichał Górny <mgorny@gentoo.org>
Mon, 8 Jul 2019 13:03:22 +0000 (15:03 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 9 Jul 2019 13:29:39 +0000 (15:29 +0200)
Correct the enewuser call not to enforce specified UID unless
ACCT_USER_ENFORCE_ID is set.

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

index ec9c859aec27a4707f455420b5afe29713f14978..60009643c144861292f26bb4eaae3a955a26d291 100644 (file)
@@ -325,8 +325,9 @@ acct-user_pkg_preinst() {
        debug-print-function ${FUNCNAME} "${@}"
 
        local groups=${ACCT_USER_GROUPS[*]}
-       enewuser -F -M "${ACCT_USER_NAME}" "${ACCT_USER_ID}" \
-               "${ACCT_USER_SHELL}" "${ACCT_USER_HOME}" "${groups// /,}"
+       enewuser ${ACCT_USER_ENFORCE_ID:+-F} -M "${ACCT_USER_NAME}" \
+               "${ACCT_USER_ID}" "${ACCT_USER_SHELL}" "${ACCT_USER_HOME}" \
+               "${groups// /,}"
 
        if [[ ${ACCT_USER_HOME} != /dev/null ]]; then
                # default ownership to user:group