[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Why was netcat reverted?
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2010-06-28 2:34:08
Message-ID: 201006280434.08269.vda.linux () googlemail ! com
[Download RAW message or body]

On Sunday 27 June 2010 21:52, Rob Landley wrote:
> On Saturday 26 June 2010 21:22:50 Denys Vlasenko wrote:
> > On Sunday 27 June 2010 03:55, Denys Vlasenko wrote:
> > > 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?
> >
> > Committed.
> 
> I'm curious: why does netcat differ from any other app we've integrated?  Our 
> cat doesn't do --squeeze-blank", is that a reason to merge the gnu version 
> alongside ours with a config option to select them?
> 
> What's the criteria here?

I needed -u, -v and -s.

Merging original version might be not the best idea, yes,
but OTOH original nc-1.10 is NOT coded by FSF - it's much saner.
Pity every single one re-implementer (BSD, GNU, Nmap)
decided that they know better and sure enough balloned their clone
into hundreds of kilobytes of code... not even bothered
to keep it compat!


> > Now, with CONFIG_NC_110_COMPAT=y
> >
> >
> > Usage: nc [OPTIONS] HOST PORT  - connect
> > nc [OPTIONS] -l -p PORT [HOST] [PORT]  - listen
> >
> > Options:
> >         -e PROG Run PROG after connect (must be last)
> >         -l      Listen mode, for inbound connects
> >         -p PORT Local port
> >         -s ADDR Local address
> >         -w SEC  Timeout for connects and final net reads
> >         -i SEC  Delay interval for lines sent
> >         -n      Don't do DNS resolution
> >         -u      UDP mode
> >         -v      Verbose
> >         -o FILE Hex dump traffic
> >         -z      Zero-I/O mode (scanning)
> >
> > and without:
> >
> > Usage: nc [-iN] [-wN] [-l] [-p PORT] [-f FILE|IPADDR PORT] [-e PROG]
> >
> > Open a pipe to IP:PORT or FILE
> >
> > Options:
> >         -e PROG Run PROG after connect
> >         -l      Listen mode, for inbound connects
> >                 (use -l twice with -e for persistent server)
> >         -p PORT Local port
> >         -w SEC  Timeout for connect
> >         -i SEC  Delay interval for lines sent
> >         -f FILE Use file (ala /dev/ttyS0) instead of network
> 
> So I need a config option to add -s, -n, -u, -v, -o, and -z to busybox netcat 
> in order for you to be happy about removing the redundant implementation? 
>
> Do you have any criteria to indicate _which_ of these are interesting, beyond 
> just "the busybox version of netcat differs from the external version in some 
> nonspecific way, and I didn't want to just build the other version and install 
> it in the system, no this must be part of _busybox_."

I need -u, -v and -s. At first, -v support
can be just a stub ("accept but ignore").

Also, I did not realize at first that nc-1.10 has option -e PROG
which does NOT allow argiments for PROG (that is, you need
-e 'sh -c "PROG ARGS"' or a helper script if you needs to pass ARGS.

Currently, we allow -e PROG ARGS, but it complicates parsing
(for one, we can't use getopt32). Getting rid of this incompatibility
might make sense - it will also make code smaller, which is always good.

 
> Also, the man page for ubuntu's netcat has 20 options, and the historical 
> version you added has 11.  Presumably this is one of those "forks" you were 
> referring to, which of course isn't the "real" version because Ubuntu only has 
> 40% market share, so obviously that's too obscure to count...

> Still not understanding the criteria here.

There wasn't any well-thought-out criteria :(
it was just me being lazy to add the support for all those
options to existing netcat which I needed.
Today I'd do it better, but three years ago I didn't.

I comitted the same crime to od...

Sorry.
-- 
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic