From f9fff8823e0cd1f6570b01337ac99e5bd49c824a Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 26 Dec 2022 02:06:21 +0000 Subject: gentoo auto-resync : 26:12:2022 - 02:06:21 --- eclass/Manifest.gz | Bin 37361 -> 37364 bytes eclass/acct-user.eclass | 51 ++++++++++++++++++++++++------------------------ 2 files changed, 25 insertions(+), 26 deletions(-) (limited to 'eclass') diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz index e87fb05182ce..560d5f97aa92 100644 Binary files a/eclass/Manifest.gz and b/eclass/Manifest.gz differ diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass index a37e12121f83..14fda76ced73 100644 --- a/eclass/acct-user.eclass +++ b/eclass/acct-user.eclass @@ -339,36 +339,35 @@ acct-user_pkg_preinst() { if egetent passwd "${ACCT_USER_NAME}" >/dev/null; then elog "User ${ACCT_USER_NAME} already exists" - return - fi - - local groups=( ${_ACCT_USER_GROUPS} ) - local aux_groups=${groups[*]:1} - local opts=( - --system - --no-create-home - --no-user-group - --comment "${_ACCT_USER_COMMENT}" - --home-dir "${_ACCT_USER_HOME}" - --shell "${_ACCT_USER_SHELL}" - --gid "${groups[0]}" - --groups "${aux_groups// /,}" - ) + else + local groups=( ${_ACCT_USER_GROUPS} ) + local aux_groups=${groups[*]:1} + local opts=( + --system + --no-create-home + --no-user-group + --comment "${_ACCT_USER_COMMENT}" + --home-dir "${_ACCT_USER_HOME}" + --shell "${_ACCT_USER_SHELL}" + --gid "${groups[0]}" + --groups "${aux_groups// /,}" + ) + + if [[ ${_ACCT_USER_ID} -ne -1 ]] && + ! egetent passwd "${_ACCT_USER_ID}" >/dev/null + then + opts+=( --uid "${_ACCT_USER_ID}" ) + fi - if [[ ${_ACCT_USER_ID} -ne -1 ]] && - ! egetent passwd "${_ACCT_USER_ID}" >/dev/null - then - opts+=( --uid "${_ACCT_USER_ID}" ) - fi + if [[ -n ${ROOT} ]]; then + opts+=( --prefix "${ROOT}" ) + fi - if [[ -n ${ROOT} ]]; then - opts+=( --prefix "${ROOT}" ) + elog "Adding user ${ACCT_USER_NAME}" + useradd "${opts[@]}" "${ACCT_USER_NAME}" || die + _ACCT_USER_ADDED=1 fi - elog "Adding user ${ACCT_USER_NAME}" - useradd "${opts[@]}" "${ACCT_USER_NAME}" || die - _ACCT_USER_ADDED=1 - if [[ ${_ACCT_USER_HOME} != /dev/null ]]; then # default ownership to user:group if [[ -z ${_ACCT_USER_HOME_OWNER} ]]; then -- cgit v1.2.3