enter_chroot: always bind $GNUPGHOME to the default path

The path of $GNUPGHOME outside the chroot may not really make sense
inside the chroot. Although that's probably not a big deal there's no
need to keep the outside value. Instead just bind it to the usual spot.
This commit is contained in:
Michael Marineau 2015-12-01 14:34:43 -08:00
parent 14646f7900
commit ec58813496

View File

@ -296,7 +296,7 @@ setup_env() {
: ${GNUPGHOME:="$SUDO_HOME/.gnupg"} : ${GNUPGHOME:="$SUDO_HOME/.gnupg"}
if [[ -d "${GNUPGHOME}" ]]; then if [[ -d "${GNUPGHOME}" ]]; then
debug "Mounting GnuPG" debug "Mounting GnuPG"
setup_mount "${GNUPGHOME}" "--bind" "${GNUPGHOME}" setup_mount "${GNUPGHOME}" "--bind" "/home/${SUDO_USER}/.gnupg"
# bind mount the gpg agent dir if available # bind mount the gpg agent dir if available
GPG_AGENT_DIR="${GPG_AGENT_INFO%/*}" GPG_AGENT_DIR="${GPG_AGENT_INFO%/*}"
@ -304,6 +304,7 @@ setup_env() {
setup_mount "$GPG_AGENT_DIR" "--bind" "$GPG_AGENT_DIR" setup_mount "$GPG_AGENT_DIR" "--bind" "$GPG_AGENT_DIR"
fi fi
fi fi
unset GNUPGHOME
# Mount additional directories as specified in .local_mounts file. # Mount additional directories as specified in .local_mounts file.
local local_mounts="${FLAGS_trunk}/src/scripts/.local_mounts" local local_mounts="${FLAGS_trunk}/src/scripts/.local_mounts"