bug-bash
[Top][All Lists]
Advanced

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

bash dies when trying to write to a tcp socket that has been closed on t


From: Ralf Goertz
Subject: bash dies when trying to write to a tcp socket that has been closed on the other end
Date: Tue, 5 Jun 2007 17:06:06 +0200
User-agent: KMail/1.9.7

Configuration Information [Automatically generated, do not change]:
Machine: i586
OS: linux-gnu
Compiler: 
gcc -I/usr/src/packages/BUILD/bash-3.2 
-L/usr/src/packages/BUILD/bash-3.2/../readline-5.2
Compilation 
CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i586' -DCONF_OSTYPE='linux-gnu' 
-DCONF_MACHTYPE='i586-suse-linux-gnu' -DCONF_VENDOR='suse' 
-DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  
-I. -I./include -I./lib   -O2 -g -m32 -march=i586 -mtune=i686 
-fmessage-length=0 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DRECYCLES_PIDS -Wall 
-pipe -g -fPIE -fbranch-probabilities
uname output: Linux lrg 2.6.18.8-0.3-default #1 SMP Tue Apr 17 08:42:35 
UTC 2007 i686 i686 i386 GNU/Linux
Machine Type: i586-suse-linux-gnu

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

Description:
        I am trying to patch bash to have it open server sockets. While I
        was debugging I found a problem with tcp sockets also present in the
        unmodified bash. bash does not seem to notice that an opened
        /dev/tcp/$host/$port file descriptor becomes invalid if the
        connection is closed on the other end.
        
Repeat-By:
        1. Open a second console and execute "netcat -l -p 5000"
        2. switch back to first console
        3. exec 5<>/dev/tcp/localhost/5000
        4. echo "Hello World" >&5
        5. switch to second console and hit <CTRL-C>
        6. switch back to first console
        7. echo "Hello World" >&5
        8. echo "Hello World" >&5
        bash has died





reply via email to

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