Re: Setting TMOUT for select is broken?

2011-01-18 Thread Chet Ramey
> Machine Type: i686-pc-linux-gnu
> 
> Bash Version: 4.1
> Patch Level: 5
> Release Status: release
> 
> Description:
>   when TMOUT is set, select just redisplay the menu, nothing is
> executed, the select never exits.

This has been fixed for the next release.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/



PS1 expansion of \W incorrect for short paths

2011-01-18 Thread Cameron Hutchison
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib   -g -O2 -Wall
uname output: Linux balrog 2.6.37-balrog-1-2-gaf41dc2 #2 SMP PREEMPT Tue 
Jan 18 11:16:08 EST 2011 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

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

Description:
Prompt expansion of \W sometimes produces garbage prompts.

Repeat-By:
$ PS1='\W$ '
~$ cd /home
hmee$ cd /proc
pocc$ cd /lib32
li332$

Fix:
In parse.y : decode_prompt_string() in the 'W' case, it uses strcpy
to copy the basename of the path to the beginning of the string.
For short strings, the src and dest args to strcpy may overlap
which is not supported by strcpy.

memmove should be used instead.

change
strcpy (t_string, t + 1);
to
memmove (t_string, t + 1, strlen(t + 1) + 1);

(untested)




[BUG] Bash does not properly check for return value of tiocgpgrp() or ioctl(TIOCGPGRP)

2011-01-18 Thread Alexey Smirnov



Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib   -g -O2 -Wall
uname output: Linux drone 2.6.32-27-generic #49-Ubuntu SMP Wed Dec 1 23:52:12 
UTC 2010 i686 GNU/Linux
Machine Type: i486-pc-linux-gnu

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

Sample program that demonstrate this:


---8<
#!/usr/bin/python

import sys
import fcntl
import termios
import struct
import os

if os.fork()>  0: sys.exit(1)

os.setsid()
qwe=os.open('/dev/ptmx', os.O_RDWR)
print struct.unpack_from('