aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-05-25 17:46:07 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2023-05-26 10:17:32 +0200
commit5b507233e6ce8f7ccfc4431f934518e15102e63a (patch)
treedb7d1bfa6b83c7940523fb9bdf1793265f72fdde /configure
parenteea2d141179e58222eb655f948a951561134b260 (diff)
configure: unset harmful environment variables
Apart from CLICOLOR_FORCE and GREP_OPTIONS, there are other variables that are listed in the Autoconf manual. While Autoconf neutralizes them very early, and assumes it does not (yet) run in a shell that has "unset", QEMU assumes that the user invoked configure under a POSIX shell, and therefore can simply use "unset" to clear them. CDPATH is particularly nasty because it messes up "cd ... && pwd". Reported-by: Juan Quintela <quintela@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure5
1 files changed, 2 insertions, 3 deletions
diff --git a/configure b/configure
index 80ca1c9221..9cdce69b78 100755
--- a/configure
+++ b/configure
@@ -4,9 +4,8 @@
#
# Unset some variables known to interfere with behavior of common tools,
-# just as autoconf does.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
+# just as autoconf does. Unlike autoconf, we assume that unset exists.
+unset CLICOLOR_FORCE GREP_OPTIONS BASH_ENV ENV MAIL MAILPATH CDPATH
# Don't allow CCACHE, if present, to use cached results of compile tests!
export CCACHE_RECACHE=yes