summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-03-02 23:26:42 +0000
committerZac Medico <zmedico@gentoo.org>2008-03-02 23:26:42 +0000
commit9f821293ac8eb72346794b153f363a88198a3314 (patch)
tree5323dc62456ad06772771c5edf8dd7bc43b0a6e6
parentf3a07ea9bd683ed27896480aeee169b619ad9f68 (diff)
downloadportage-9f821293ac8eb72346794b153f363a88198a3314.tar.gz
portage-9f821293ac8eb72346794b153f363a88198a3314.tar.bz2
portage-9f821293ac8eb72346794b153f363a88198a3314.zip
Bug #211949 - As suggested by vapier, tighten the variable filter to also
exclude variable names that begin with a digit or that contain any non-alphanumeric characters that are not be supported by bash. svn path=/main/trunk/; revision=9416
-rwxr-xr-xbin/ebuild.sh6
-rwxr-xr-xbin/filter-bash-environment.py1
2 files changed, 5 insertions, 2 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 1e0af3e24..4773d9b44 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1393,8 +1393,9 @@ PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
# with names that are known to cause interference:
#
# * some specific variables for which bash does not allow assignment
-# * any variables with names containing a hyphen (not allowed by bash)
# * some specific variables that affect portage or sandbox behavior
+# * variable names that begin with a digit or that contain any
+# non-alphanumeric characters that are not be supported by bash
#
# --filter-sandbox causes all SANDBOX_* variables to be filtered, which
# is only desired in certain cases, such as during preprocessing or when
@@ -1423,7 +1424,8 @@ filter_readonly_variables() {
SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
SANDBOX_LOG SANDBOX_ON"
filtered_vars="${readonly_bash_vars} ${READONLY_PORTAGE_VARS}
- BASH_[_[:alnum:]]* PATH [-_[:alnum:]]*-[-_[:alnum:]]*"
+ BASH_[_[:alnum:]]* PATH
+ [[:digit:]][_[:alnum:]]* [_[:alnum:]]*[^_[:alnum:]][_[:alnum:]]*"
if hasq --filter-sandbox $* ; then
filtered_vars="${filtered_vars} SANDBOX_[_[:alnum:]]*"
else
diff --git a/bin/filter-bash-environment.py b/bin/filter-bash-environment.py
index 83b250b69..691d406da 100755
--- a/bin/filter-bash-environment.py
+++ b/bin/filter-bash-environment.py
@@ -7,6 +7,7 @@ import os, re, sys
egrep_compat_map = {
"[:alnum:]" : r'\w',
+ "[:digit:]" : r'\d',
"[:space:]" : r'\s',
}