From e4bd03ae54359072a26e767aa68a9a37d7a65488 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 9 Dec 2009 00:30:46 +0000 Subject: Fix handling for TEMP, TMP, and TMPDIR variables: * Add to whitelist so current values are always used. * Always filter them from the saved environment. * Always add thier values to SANDBOX_WRITE. svn path=/main/trunk/; revision=14973 --- bin/ebuild.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bin/ebuild.sh') diff --git a/bin/ebuild.sh b/bin/ebuild.sh index ef8dc2a0d..fd14314d6 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -11,6 +11,12 @@ PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}" # environment by modifying our PATH. unset BASH_ENV +# Avoid sandbox violations in temporary directories. +for x in TEMP TMP TMPDIR ; do + [[ -n ${!x} ]] && export SANDBOX_WRITE="${SANDBOX_WRITE:+${SANDBOX_WRITE}:}${!x}" +done +unset x + # sandbox's bashrc sources /etc/profile which unsets ROOTPATH, # so we have to back it up and restore it. if [ -n "${PORTAGE_ROOTPATH}" ] ; then -- cgit v1.2.3-1-g7c22