bash man page doesn't fully document PATH

2005-08-31 Thread pgf
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' 
-DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H  -D_GNU_SOURCE 
-D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./lib -I/usr/include -O2 
-march=i386 -mcpu=i686
uname output: Linux grass 2.4.29 #1 Wed Mar 23 09:00:50 EST 2005 i686 unknown
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.05
Patch Level: 8
Release Status: release

Description:
Empty elements in PATH (leading, trailing, or double ":"
characters have always meant "current directory".  The
bash manpage makes no mention of this behavior, and the
examples given all use ":.:" to represent current
directory, leading to the impression that this is the
only way current directory can enter the command search. 
The traditional behavior should be well-documented, both
to reduce confusion and to enhance security.

Repeat-By:

Fix:
The following patch is a possibility:

--- bash.1.orig Wed Aug 31 10:27:35 2005
+++ bash.1  Wed Aug 31 10:37:22 2005
@@ -1679,6 +1679,16 @@
 A common value is
 .if t \f(CW/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.\fP.
 .if n ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.''.
+Note that empty entries in PATH (i.e. a double colon pair, or 
+leading or trailing colon characters) are treated as representing
+the current directory.  Thus
+.if t \f(CW:/usr/local/bin::/bin:/usr/bin:\fP
+.if n ``:/usr/local/bin::/bin:/usr/bin:''
+is equivalent to
+.if t \f(CW.:/usr/local/bin:.:/bin:/usr/bin:.\fP.
+.if n ``.:/usr/local/bin:.:/bin:/usr/bin:.''.
+(This historic behavior can be surprising, and can have security
+consequences.)
 .TP
 .B POSIXLY_CORRECT
 If this variable is in the environment when \fBbash\fP starts, the shell


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


"read -n" miscounts if typed characters are control chars

2005-04-14 Thread pgf
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' 
-DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H  -D_GNU_SOURCE 
-D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./lib -I/usr/include -O2 
-march=i386 -mcpu=i686
uname output: Linux grass 2.4.29 #1 Wed Mar 23 09:00:50 EST 2005 i686 unknown
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.05
Patch Level: 8
Release Status: release

Description:
if "read -n" is used to read control character input from
a tty, it will miscount the input characters by a factor
of two.

Repeat-By:
$ read -n 5 a
^A^A^A$ 
$
$ echo $a | hexdump -c
000 001 001 001  \n
004



___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash