diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-12-01 22:26:29 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-12-01 22:26:29 +0000 |
commit | 94b68f3fa1487c9b32c0646c3c4e4ee339b9f866 (patch) | |
tree | 475f67a7174561e5fce68eb13b4cd89795b87fdf | |
parent | 7ed7d923630b26eb296fd8db5ac8690c55c4c166 (diff) | |
download | portage-94b68f3fa1487c9b32c0646c3c4e4ee339b9f866.tar.gz portage-94b68f3fa1487c9b32c0646c3c4e4ee339b9f866.tar.bz2 portage-94b68f3fa1487c9b32c0646c3c4e4ee339b9f866.zip |
* whitelist some misc variables from the calling environment
* blacklist the same variables in save_ebuild_env() so that
the latest values from the calling environment always
override those from the ebuild environment
svn path=/main/trunk/; revision=8796
-rwxr-xr-x | bin/isolated-functions.sh | 4 | ||||
-rw-r--r-- | pym/portage/__init__.py | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 0147a0b16..fc832a51f 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -405,6 +405,10 @@ save_ebuild_env() { unset COLORTERM DISPLAY EDITOR LESS LESSOPEN LOGNAME LS_COLORS PAGER \ TERM TERMCAP USER + # other variables inherited from the calling environment + unset CVS_RSH ECHANGELOG_USER GPG_AGENT_INFO \ + SSH_AGENT_PID SSH_AUTH_SOCK STY WINDOW XAUTHORITY + # There's no need to bloat environment.bz2 with internally defined # functions and variables, so filter them out if possible. diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index ba978bb28..222130929 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -880,6 +880,14 @@ class config(object): "TERM", "TERMCAP", "USER", ] + # other variables inherited from the calling environment + _environ_whitelist += [ + "CVS_RSH", "ECHANGELOG_USER", + "GPG_AGENT_INFO", + "SSH_AGENT_PID", "SSH_AUTH_SOCK", + "STY", "WINDOW", "XAUTHORITY", + ] + _environ_whitelist = frozenset(_environ_whitelist) # Filter selected variables in the config.environ() method so that @@ -888,10 +896,7 @@ class config(object): # misc variables inherited from the calling environment _environ_filter += [ - "CVS_RSH", "ECHANGELOG_USER", - "GPG_AGENT_INFO", "INFOPATH", "MANPATH", - "SSH_AGENT_PID", "SSH_AUTH_SOCK", - "STY", "WINDOW", "XAUTHORITY", + "INFOPATH", "MANPATH", ] # portage config variables and variables set directly by portage |