diff -ru nc/Makefile nc-patched/Makefile --- nc/Makefile Wed Mar 20 04:16:06 1996 +++ nc-patched/Makefile Wed Dec 29 11:44:19 2021 @@ -109,6 +109,11 @@ next: make -e $(ALL) $(MFLAGS) XFLAGS='-DNEXT' STATIC=-Bstatic +# Darwin / Mac OS X: Modernized NeXT, no fully static linking, no stripping +darwin: + make -e $(ALL) $(MFLAGS) LD='$(CC)' XFLAGS='-DNEXT' STATIC= \ + XLIBS='-lresolv' + # start with this for a new architecture, and see what breaks. generic: make -e $(ALL) $(MFLAGS) XFLAGS='-DGENERIC' STATIC= diff -ru nc/netcat.c nc-patched/netcat.c --- nc/netcat.c Thu Mar 21 01:38:04 1996 +++ nc-patched/netcat.c Thu Sep 20 13:44:03 2001 @@ -40,9 +40,6 @@ #else #include #endif -#ifdef HAVE_SELECT_H /* random SV variants need this */ -#include -#endif /* have to do this *before* including types.h. xxx: Linux still has it wrong */ #ifdef FD_SETSIZE /* should be in types.h, butcha never know. */ @@ -50,6 +47,10 @@ #endif /* fd's, something is horribly wrong! */ #define FD_SETSIZE 16 /* <-- this'll give us a long anyways, wtf */ #include /* *now* do it. Sigh, this is broken */ + +#ifdef HAVE_SELECT_H /* random SV variants need this */ +#include +#endif #ifdef HAVE_RANDOM /* aficionados of ?rand48() should realize */ #define SRAND srandom /* that this doesn't need *strong* random */ @@ -68,11 +68,14 @@ #include /* IPOPT_LSRR, header stuff */ #include /* hostent, gethostby*, getservby* */ #include /* inet_ntoa */ +#include +#include #include #include /* strcpy, strchr, yadda yadda */ #include #include #include /* O_WRONLY et al */ +#include /* close, sleep, alarm, et al */ /* handy stuff: */ #define SA struct sockaddr /* socket overgeneralization braindeath */ @@ -215,6 +216,47 @@ exit (1); } /* bail */ +#ifdef HAVE_HELP /* unless we wanna be *really* cryptic */ +/* helpme : + the obvious */ +helpme() +{ + o_verbose = 1; + holler ("[v1.10]\n\ +connect to somewhere: nc [-options] hostname port[s] [ports] ... \n\ +listen for inbound: nc -l -p port [-options] [hostname] [port]\n\ +options:"); +/* sigh, this necessarily gets messy. And the trailing \ characters may be + interpreted oddly by some compilers, generating or not generating extra + newlines as they bloody please. u-fix... */ +#ifdef GAPING_SECURITY_HOLE /* needs to be separate holler() */ + holler ("\ + -e prog program to exec after connect [dangerous!!]"); +#endif + holler ("\ + -g gateway source-routing hop point[s], up to 8\n\ + -G num source-routing pointer: 4, 8, 12, ...\n\ + -h this cruft\n\ + -i secs delay interval for lines sent, ports scanned\n\ + -l listen mode, for inbound connects\n\ + -n numeric-only IP addresses, no DNS\n\ + -o file hex dump of traffic\n\ + -p port local port number\n\ + -r randomize local and remote ports\n\ + -s addr local source address"); +#ifdef TELNET + holler ("\ + -t answer TELNET negotiation"); +#endif + holler ("\ + -u UDP mode\n\ + -v verbose [use twice to be more verbose]\n\ + -w secs timeout for connects and final net reads\n\ + -z zero-I/O mode [used for scanning]"); + bail ("port numbers can be individual or ranges: lo-hi [inclusive]"); +} /* helpme */ +#endif /* HAVE_HELP */ + /* catch : no-brainer interrupt handler */ void catch () @@ -1624,45 +1666,4 @@ exit (0); /* otherwise, we're just done */ } /* main */ -#ifdef HAVE_HELP /* unless we wanna be *really* cryptic */ -/* helpme : - the obvious */ -helpme() -{ - o_verbose = 1; - holler ("[v1.10]\n\ -connect to somewhere: nc [-options] hostname port[s] [ports] ... \n\ -listen for inbound: nc -l -p port [-options] [hostname] [port]\n\ -options:"); -/* sigh, this necessarily gets messy. And the trailing \ characters may be - interpreted oddly by some compilers, generating or not generating extra - newlines as they bloody please. u-fix... */ -#ifdef GAPING_SECURITY_HOLE /* needs to be separate holler() */ - holler ("\ - -e prog program to exec after connect [dangerous!!]"); -#endif - holler ("\ - -g gateway source-routing hop point[s], up to 8\n\ - -G num source-routing pointer: 4, 8, 12, ...\n\ - -h this cruft\n\ - -i secs delay interval for lines sent, ports scanned\n\ - -l listen mode, for inbound connects\n\ - -n numeric-only IP addresses, no DNS\n\ - -o file hex dump of traffic\n\ - -p port local port number\n\ - -r randomize local and remote ports\n\ - -s addr local source address"); -#ifdef TELNET - holler ("\ - -t answer TELNET negotiation"); -#endif - holler ("\ - -u UDP mode\n\ - -v verbose [use twice to be more verbose]\n\ - -w secs timeout for connects and final net reads\n\ - -z zero-I/O mode [used for scanning]"); - bail ("port numbers can be individual or ranges: lo-hi [inclusive]"); -} /* helpme */ -#endif /* HAVE_HELP */ - /* None genuine without this seal! _H*/