commit:     ee0b97b10ce02d42e608e477d97629c6591e3489
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 15 15:41:25 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Aug 15 18:15:29 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee0b97b1

acct-user.eclass: die explicitly if HOME is missing in preinst

Closes: https://bugs.gentoo.org/691478
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 eclass/acct-user.eclass | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
index 60009643c14..008dc6bb7d6 100644
--- a/eclass/acct-user.eclass
+++ b/eclass/acct-user.eclass
@@ -334,6 +334,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

Reply via email to