On Fri, Sep 09, 2011 at 03:04:19AM -0400, Brynet wrote:
> I think this was a feature, right? :-)
Here it is again, this time with the man page bits.
UDP port scanning doesn't make much sense, so prevent -u and -z from
being used at the same time.
ok?
-Bryan.
Index: nc.1
===================================================================
RCS file: /cvs/src/usr.bin/nc/nc.1,v
retrieving revision 1.59
diff -u -p -u -r1.59 nc.1
--- nc.1 4 Oct 2011 08:34:34 -0000 1.59
+++ nc.1 5 Feb 2012 19:14:37 -0000
@@ -258,7 +258,9 @@ Specifies that
should just scan for listening daemons, without sending any data to them.
It is an error to use this option in conjunction with the
.Fl l
-option.
+or
+.Fl u
+options.
.El
.Pp
.Ar destination
Index: netcat.c
===================================================================
RCS file: /cvs/src/usr.bin/nc/netcat.c,v
retrieving revision 1.103
diff -u -p -u -r1.103 netcat.c
--- netcat.c 4 Oct 2011 08:34:34 -0000 1.103
+++ netcat.c 5 Feb 2012 19:14:38 -0000
@@ -276,6 +276,8 @@ main(int argc, char *argv[])
errx(1, "cannot use -p and -l");
if (lflag && zflag)
errx(1, "cannot use -z and -l");
+ if (uflag && zflag)
+ errx(1, "cannot use -z and -u");
if (!lflag && kflag)
errx(1, "must use -l with -k");