[patch] prevent BASH env pollution from corrupting AC_PATH_PROG(bash) search

Mike Frysinger vapier@gentoo.org
Fri Jun 1 19:31:00 GMT 2007


the configure script searches for `bash` so that it can put it into bash 
scripts (like ldd) via @BASH@:
AC_PATH_PROG(BASH, bash, no)
this means try to locate the program "bash" in $PATH and set the variable 
$BASH to it when found.  but if the variable $BASH is already set, skip any 
search and just use that.

bash has a neat feature where it automatically sets the variable $BASH to how 
it was invoked:
$ /bin/sh -c 'echo $BASH'
/bin/sh
$ /bin/bash -c 'echo $BASH'
/bin/bash
$ ln -s /bin/bash mooooooo
$ ./mooooooo -c 'echo $BASH'
/home/vapier/mooooooo

this causes the aforementioned test to be troublesome when:
 - /bin/sh is set to /bin/bash
 - glibc is compiled and /bin/sh is recorded in /usr/bin/ldd
 - /bin/sh is switched to say /bin/dash
 - ldd fails due to it not being POSIX compliant shell code

i'd propose ldd be tweaked to be POSIX compliant, but that idea was shot down 
back in January of this year ... so instead, i'll propose tweaking the 
configure script so that the internal bash env pollution doesnt break the 
intent of the AC_PATH_PROG(bash) test
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20070601/f8aa6fd1/attachment.sig>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: glibc-bash-prog-search.patch
Type: text/x-diff
Size: 545 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20070601/f8aa6fd1/attachment.bin>


More information about the Libc-alpha mailing list