bug#1242: [BusyBox] bug#1242: netcat '-i' option

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Sat Apr 27 05:01:03 UTC 2002


On Fri, 26 Apr 2002, Erik Andersen wrote:

> On Sat Apr 20, 2002 at 10:00:20PM +0200, Cristian Ionescu-Idbohrn wrote:
> > Package: busybox
> > Version: 0.61.pre+cvs+2002-04-20:21:01
> > Severity: wishlist
> >
> > Would you please add the '-i' option to netcat. It seems to be
> > required in order to be able to talk to an smtp-server.
>
> done.

Thanks Eric,

Unfortunatelly, it looks like I was not completelly right about the
simplicity of that change. It doesn't break anything, AFAICT, but it's
not sufficient. And here is why (I guess):

+ it looks like the pause needs to happen after each new line '\n'
+ the call to the 'full_write' function:

,---- networking/nc.c
| 167                                 if (full_write(ofd, buf, nread) < 0)
| 168                                         perror_msg_and_die("write");
`----

  doesn't care if there are '\n' characters in that buffer, and it
  won't split the buffer into smaller ones (ending after the '\n'
  characters)

+ so, to really be able to achieve the desired effect, one needs to
  locate the '\n' characters in the input buffer, split and send, sleep
  for the amount of seconds specified with the '-i' option and repeat
  until the end of the input buffer

Sorry for my poor first analysis. I'm not 100% sure I do the right
guessing job now either, but you should be probably able to say if
this one is flawed too.


Cheers,
Cristian




More information about the busybox mailing list