aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'bin/eselect.in')
-rwxr-xr-xbin/eselect.in13
1 files changed, 12 insertions, 1 deletions
diff --git a/bin/eselect.in b/bin/eselect.in
index c59a09d..483a572 100755
--- a/bin/eselect.in
+++ b/bin/eselect.in
@@ -53,13 +53,24 @@ EROOT="${ROOT%${EPREFIX:+/}}${EPREFIX}"
"unalias" -a
unset -f rm
unset CDPATH GLOBIGNORE
-IFS=$' \t\n'
shopt -s extglob
shopt -s expand_aliases
umask +rx
+# Sanitise PATH: We don't want to execute Portage's internal helpers
+# if we're called from an ebuild.
+IFS=:
+read -r -d '' -a path <<<"${PATH}"
+for i in "${!path[@]}"; do
+ [[ ${path[i]} == */portage?(/*)/ebuild-helpers?(/*) ]] && unset "path[i]"
+done
+PATH="${path[*]}"
+unset i path
+
+IFS=$' \t\n'
+
# Save stderr file descriptor
if (( BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 1 || BASH_VERSINFO[0] > 4 ))
then