diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-12-10 01:04:26 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-12-10 01:04:26 +0000 |
commit | 920e551da78dcd0099ab0432f4d4a4b20c7f5051 (patch) | |
tree | 3bf9d8f651b0608def23f33f9e5ef53e302ece0b /bin/ebuild.sh | |
parent | abd5377f55f1a3746e20087d9f10e88e2e522115 (diff) | |
download | portage-920e551da78dcd0099ab0432f4d4a4b20c7f5051.tar.gz portage-920e551da78dcd0099ab0432f4d4a4b20c7f5051.tar.bz2 portage-920e551da78dcd0099ab0432f4d4a4b20c7f5051.zip |
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. (trunk r14973)
svn path=/main/branches/2.1.7/; revision=15007
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-x | bin/ebuild.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index d5d654b40..404269b38 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -17,6 +17,12 @@ export SANDBOX_READ="${SANDBOX_READ:+${SANDBOX_READ}:}/dev/stdin" # 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 |