On Fri, May 02, 2008 at 11:27:00PM +0800, jidanni@jidanni.org wrote:
> SC> Try
> SC> sudo env -i SHELLOPTS=xtrace su -p - nobody
> (I don't use sudo)
> uid=0(root) gid=0(root) groups=0(root)
> # env -i SHELLOPTS=xtrace su -p - nobody
> + PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
> + '[' /bin/sh ']'
> + PS1='\u@\h:\w\$ '
> + export PATH
> + umask 022
> nobody@jidanni2:/root$ kill -1 $$
> + kill -1 6215
> # env -i SHELLOPTS=xtrace su -p - nobody
> + PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
> + '[' /bin/sh ']'
> + PS1='\u@\h:\w\$ '
> + export PATH
> + umask 022
> nobody@jidanni2:/root$ logout
> #
[...]
Could be a tty setting as well.
stty min 0 time 10 -icanon
could reproduce that if bash was built without readline I think.
With readline, bash is meant to reset those min and time
parameters before each prompt. Maybe it fails to do so in which
case strace will tell you as well.
What does stty -a tell you?
--
Stéphane