Why was netcat reverted?
vda.linux at googlemail.com
Sun Jun 27 01:55:52 UTC 2010
On Sunday 27 June 2010 02:51, Rob Landley wrote:
> So I'm trying to phase out toybox in aboriginal Linux and push everything I
> need upstream into busybox, and I'm down to two commands I still need from
> toybox: my patch implementation, and my netcat implementation.
> I was looking at porting my toybox implementation of netcat over to busybox,
> but the complication is that the busybox netcat implementation used to do
> everything I need, back in the 1.9 release. Then the one that was in there
> got blown away and replaced with an external netcat implementation for no
> apparent reason.
> I did a make baseline/bloatcheck between 29fe7265b8c1917eb^1 and
> 29fe7265b8c1917eb, and found that the results differ by 11 bytes. Except the
> "new" one doesn't have -f (allowing it to scriptably attach to char devices
> such as serial consoles), and it doesn't have server mode (allowing it to work
> as a poor man's inetd and wrap busybox's ftpd).
Rob, 29fe7265b8c1917eb did not remove any code from nc.c,
it only added nc_bloaty.c which is used with CONFIG_DESKTOP.
With CONFIG_DESKTOP off, even current tree does this:
# ./busybox nc --help
BusyBox v1.17.0.git (2010-06-27 03:40:58 CEST) multi-call binary.
Usage: nc [-iN] [-wN] [-l] [-p PORT] [-f FILENAME|IPADDR PORT] [-e PROG]
Open a pipe to IP:port or file
-e PROG Run PROG after connect
-i SEC Delay interval for lines sent
-w SEC Timeout for connect
-f FILE Use file (ala /dev/ttyS0) instead of network
-l Listen mode, for inbound connects
(use -l twice with -e for persistent server)
-p PORT Local port
And -f works:
# echo "HELLO" | ./busybox nc -f /dev/tty >out
HELLO <--- nc says to me
bye<cr> <--- I enter this
^D <--- I enter this
# cat out
I didn't test -ll, but I suppose it works too.
> So, loss of significant functionality, size change 11 bytes.
> Why did this happen, and is there any significant reason I can't just revert it
> to the old version that _did_ do these things, and/or bring in the toybox
> version that does them?
nc_bloaty.c was added because I need nc which is compatible with
original nc-1.10. It has no -f, and doesn't support -ll,
whereas our nc was lacking a few things nc-1.10 had
(don't remember off-hand which things).
Every single fork of nc (there are at least four)
grew tons of incompatible extensions, which is a PITA for users.
I do not want to follow them...
But rants aside... I will make it so that it will be possible
to select "your" or "mine/compatible/bloated" nc with dedicated
CONFIG_NC_110_COMPAT option. You can set it to off.
Does this solve the problem for you?
More information about the busybox