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