* [PATCH] configure: unset harmful environment variables
@ 2023-05-25 15:47 Paolo Bonzini
2023-05-25 18:51 ` Juan Quintela
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2023-05-25 15:47 UTC (permalink / raw)
To: qemu-devel; +Cc: Juan Quintela, qemu-stable
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>
---
configure | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index db1f02346e68..42861ebc6e22 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
--
2.40.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] configure: unset harmful environment variables
2023-05-25 15:47 [PATCH] configure: unset harmful environment variables Paolo Bonzini
@ 2023-05-25 18:51 ` Juan Quintela
0 siblings, 0 replies; 2+ messages in thread
From: Juan Quintela @ 2023-05-25 18:51 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, qemu-stable
Paolo Bonzini <pbonzini@redhat.com> wrote:
> 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".
It is weird that nobody noticed it. I have been using that CDPATH since
last century. Yeap, that makes me definitely old.
> Reported-by: Juan Quintela <quintela@redhat.com>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Tested-by: Juan Quintela <quintela@redhat.com>
Thanks very much.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-25 18:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-25 15:47 [PATCH] configure: unset harmful environment variables Paolo Bonzini
2023-05-25 18:51 ` Juan Quintela
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).