diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-12-26 02:06:21 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-12-26 02:06:21 +0000 |
commit | f9fff8823e0cd1f6570b01337ac99e5bd49c824a (patch) | |
tree | 2a69b85ea6ba19c3a6b492d49ee8cd14c887472d /eclass | |
parent | d117172e3b48fc4be82b7623ffc40bb6070ef361 (diff) |
gentoo auto-resync : 26:12:2022 - 02:06:21
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/Manifest.gz | bin | 37361 -> 37364 bytes | |||
-rw-r--r-- | eclass/acct-user.eclass | 51 |
2 files changed, 25 insertions, 26 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex e87fb05182ce..560d5f97aa92 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz 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 |