diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-12-09 00:30:46 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-12-09 00:30:46 +0000 |
commit | e4bd03ae54359072a26e767aa68a9a37d7a65488 (patch) | |
tree | d05cf083d6dbc921b998d9c38c6b4b6a007fadc3 | |
parent | 3a3f1b1f3b61bda1591706d67e17daa5ca5f8d1a (diff) | |
download | portage-e4bd03ae54359072a26e767aa68a9a37d7a65488.tar.gz portage-e4bd03ae54359072a26e767aa68a9a37d7a65488.tar.bz2 portage-e4bd03ae54359072a26e767aa68a9a37d7a65488.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.
svn path=/main/trunk/; revision=14973
-rwxr-xr-x | bin/ebuild.sh | 6 | ||||
-rwxr-xr-x | bin/isolated-functions.sh | 2 | ||||
-rw-r--r-- | pym/portage/__init__.py | 5 |
3 files changed, 12 insertions, 1 deletions
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 diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index a557d9fd9..4f1ad1c63 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -564,7 +564,7 @@ save_ebuild_env() { PROFILE_PATHS PWORKDIR QA_INTERCEPTORS \ RC_DEFAULT_INDENT RC_DOT_PATTERN RC_ENDCOL \ RC_INDENTATION READONLY_EBUILD_METADATA READONLY_PORTAGE_VARS \ - ROOT ROOTPATH RPMDIR STARTDIR TMP TMPDIR USE_EXPAND \ + ROOT ROOTPATH RPMDIR STARTDIR TEMP TMP TMPDIR USE_EXPAND \ WARN XARGS _RC_GET_KV_CACHE # user config variables diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 45e5407f8..7b892a652 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -1432,6 +1432,11 @@ class config(object): "TERM", "TERMCAP", "USER", ] + # tempdir settings + _environ_whitelist += [ + "TMPDIR", "TEMP", "TMP", + ] + # other variables inherited from the calling environment _environ_whitelist += [ "CVS_RSH", "ECHANGELOG_USER", |