diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-08-18 18:16:17 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-08-18 18:16:17 +0100 |
commit | fc637fb28da700da71ec2064d65ca5a7a31b9c6c (patch) | |
tree | 326613a08f25851c388715e205576a2e7d25dc4f /eclass/acct-user.eclass | |
parent | b24bd25253fe093f722ab576d29fdc41d04cb1ee (diff) |
gentoo resync : 18.08.2019
Diffstat (limited to 'eclass/acct-user.eclass')
-rw-r--r-- | eclass/acct-user.eclass | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass index 60009643c144..fa4f9daef8f7 100644 --- a/eclass/acct-user.eclass +++ b/eclass/acct-user.eclass @@ -67,6 +67,9 @@ readonly ACCT_USER_NAME # @DESCRIPTION: # Preferred UID for the new user. This variable is obligatory, and its # value must be unique across all user packages. +# +# Overlays should set this to -1 to dynamically allocate UID. Using -1 +# in ::gentoo is prohibited by policy. # @ECLASS-VARIABLE: ACCT_USER_ENFORCE_ID # @DESCRIPTION: @@ -279,6 +282,7 @@ acct-user_pkg_pretend() { # verify ACCT_USER_ID [[ -n ${ACCT_USER_ID} ]] || die "Ebuild error: ACCT_USER_ID must be set!" + [[ ${ACCT_USER_ID} -eq -1 ]] && return [[ ${ACCT_USER_ID} -ge 0 ]] || die "Ebuild errors: ACCT_USER_ID=${ACCT_USER_ID} invalid!" # check for ACCT_USER_ID collisions early @@ -334,6 +338,14 @@ acct-user_pkg_preinst() { if [[ -z ${ACCT_USER_HOME_OWNER} ]]; then ACCT_USER_HOME_OWNER=${ACCT_USER_NAME}:${ACCT_USER_GROUPS[0]} fi + # Path might be missing due to INSTALL_MASK, etc. + # https://bugs.gentoo.org/691478 + if [[ ! -e "${ED}/${ACCT_USER_HOME#/}" ]]; then + eerror "Home directory is missing from the installation image:" + eerror " ${ACCT_USER_HOME}" + eerror "Check INSTALL_MASK for entries that would cause this." + die "${ACCT_USER_HOME} does not exist" + fi fowners "${ACCT_USER_HOME_OWNER}" "${ACCT_USER_HOME}" fperms "${ACCT_USER_HOME_PERMS}" "${ACCT_USER_HOME}" fi |