acct-user.eclass: die explicitly if HOME is missing in preinst
authorMike Gilbert <floppym@gentoo.org>
Thu, 15 Aug 2019 15:41:25 +0000 (11:41 -0400)
committerMike Gilbert <floppym@gentoo.org>
Thu, 15 Aug 2019 18:15:29 +0000 (14:15 -0400)
Closes: https://bugs.gentoo.org/691478
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
eclass/acct-user.eclass

index 60009643c144861292f26bb4eaae3a955a26d291..008dc6bb7d6888af61256afb5dc835aaa37be90d 100644 (file)
@@ -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