[BusyBox-cvs] [BusyBox 0000263]: nc cannot use -e when initiating a tcp connection to something else

bugs at busybox.net bugs at busybox.net
Thu May 19 16:32:51 UTC 2005


The following issue has been SUBMITTED.
======================================================================
<http://busybox.net/bugs/view.php?id=263> 
======================================================================
Reported By:                owlman
Assigned To:                BusyBox
======================================================================
Project:                    BusyBox
Issue ID:                   263
Category:                   Networking Support
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
======================================================================
Date Submitted:             05-19-2005 09:32 PDT
Last Modified:              05-19-2005 09:32 PDT
======================================================================
Summary:                    nc cannot use -e when initiating a tcp connection to
something else
Description: 
Host A is a full linux.
Host B is a busybox.

A$ nc -l -p 3000
B$ nc -e /bin/sh A 3000

The connection goes up and immediately down, because the busybox nc
close()s stdin (filedescriptor 0), then socket()s the connection to the
next available filedescriptor (0), then starts the filedescriptor
duplication spree: dup2(0, 0); close(0); dup2(0,1); dup2(0,2).

The attached patch removes the first close()ing of stdin, because the
first dup2() does it for us
======================================================================

Issue History
Date Modified  Username       Field                    Change              
======================================================================
05-19-05 09:32 owlman         New Issue                                    
05-19-05 09:32 owlman         File Added: nc.c.diff                        
======================================================================




More information about the busybox-cvs mailing list