bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

botched configure check for /dev/stdin


From: Eric Blake
Subject: botched configure check for /dev/stdin
Date: Wed, 15 Nov 2006 06:43:41 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.8) Gecko/20061025 Thunderbird/1.5.0.8 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Configuration Information:
Machine: i686
OS: cygwin
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686'
- -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin' -DCONF_VENDOR='pc'
- -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H
- -DRECYCLES_PIDS   -I.  -I/tmp/bash-3.2 -I/tmp/bash-3.2/include
- -I/tmp/bash-3.2/lib   -O2
uname output: CYGWIN_NT-5.1 LOUNGE 1.5.21(0.156/4/2) 2006-07-30 14:21 i686
Cygwin
Machine Type: i686-pc-cygwin

Bash Version: 3.2
Patch Level: 5
Release Status: release

Description:
        The configure check for whether /dev/stdin is available is flawed,
since it invokes 'test -r /dev/stdin </dev/null'.  However, when
configuring with a version of bash that already fakes /dev/stdin, this
means that the next configure run on bash will assume that /dev/stdin.

Repeat-By:
        configure and install bash 3.2.5 on cygwin (or any other platform
without /dev/stdin).  Then reconfigure.  Compare the two resulting
config.h; they differ by:
- --- /tmp/bash/bash-3.2-4/.build/config.h        2006-10-24
+++ config.h    2006-11-09 06:13:01.687500000 -0700
07:17:31.125000000 -0600
@@ -473,7 +473,7 @@
 #define DEV_FD_PREFIX "/proc/self/fd/"

 /* Define if you have the /dev/stdin device. */
- -/* #undef HAVE_DEV_STDIN */
+#define HAVE_DEV_STDIN 1


 /* Type and behavior of signal handling functions. */

And with that difference, the new bash fails:
$ echo $BASH_VERSION > /dev/stdout
$

where the old bash succeeded
$ echo $BASH_VERSION > /dev/stdout
3.2.1(4)-release
$

Fix:
        Apply this patch and rerun autoconf before configuring.  Using
/bin/test instead of test bypasses the bash builtin, and thus bypasses an
installed bash's internal special-casing of /dev/stdin.

- --- aclocal.m4.orig     2006-11-15 06:35:11.780250000 -0700
+++ aclocal.m4  2006-11-15 06:35:38.577125000 -0700
@@ -1574,7 +1574,7 @@
 AC_CACHE_VAL(bash_cv_dev_stdin,
 [if test -d /dev/fd && test -r /dev/stdin < /dev/null; then
    bash_cv_dev_stdin=present
- - elif test -d /proc/self/fd && test -r /dev/stdin < /dev/null; then
+ elif test -d /proc/self/fd && /bin/test -r /dev/stdin < /dev/null; then
    bash_cv_dev_stdin=present
  else
    bash_cv_dev_stdin=absent

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFWxmN84KuGfSFAYARAr7mAKCEtgAG/TK6A+FDJJbiju1KV3wgngCeLEZu
fWLI21/shbAssMieyZo4qCo=
=Yizh
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]