From 7383bf673b2dc2b093dd31038a6d43e2020f742b Mon Sep 17 00:00:00 2001 From: kinichiro Date: Tue, 7 Feb 2017 18:38:03 +0900 Subject: [PATCH] Fix patch for netcat.c --- patches/netcat.c.patch | 44 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/patches/netcat.c.patch b/patches/netcat.c.patch index 4d2f893..8d23e83 100644 --- a/patches/netcat.c.patch +++ b/patches/netcat.c.patch @@ -1,5 +1,5 @@ ---- apps/nc/netcat.c.orig Sat Nov 5 14:00:01 2016 -+++ apps/nc/netcat.c Sat Nov 5 15:28:35 2016 +--- apps/nc/netcat.c.orig 2017-02-07 17:12:34.169650728 +0900 ++++ apps/nc/netcat.c 2017-02-07 17:12:55.465651976 +0900 @@ -65,7 +65,9 @@ #define POLL_NETIN 2 #define POLL_STDOUT 3 @@ -8,9 +8,9 @@ #define DEFAULT_CA_FILE "/etc/ssl/cert.pem" +#endif - #define TLS_LEGACY (1 << 1) + #define TLS_ALL (1 << 1) #define TLS_NOVERIFY (1 << 2) -@@ -93,9 +95,13 @@ +@@ -93,9 +95,13 @@ int zflag; /* Port Scan Flag */ int Dflag; /* sodebug */ int Iflag; /* TCP receive buffer size */ int Oflag; /* TCP send buffer size */ @@ -24,16 +24,16 @@ int usetls; /* use TLS */ char *Cflag; /* Public cert file */ -@@ -148,7 +154,7 @@ +@@ -148,7 +154,7 @@ main(int argc, char *argv[]) struct servent *sv; socklen_t len; struct sockaddr_storage cliaddr; -- char *proxy; -+ char *proxy = NULL; - const char *errstr, *proxyhost = "", *proxyport = NULL; +- char *proxy, *proxyport = NULL; ++ char *proxy = NULL, *proxyport = NULL; + const char *errstr; struct addrinfo proxyhints; char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; -@@ -258,12 +264,14 @@ +@@ -258,12 +264,14 @@ main(int argc, char *argv[]) case 'u': uflag = 1; break; @@ -48,7 +48,7 @@ case 'v': vflag = 1; break; -@@ -299,9 +307,11 @@ +@@ -299,9 +307,11 @@ main(int argc, char *argv[]) case 'o': oflag = optarg; break; @@ -60,7 +60,7 @@ case 'T': errstr = NULL; errno = 0; -@@ -325,9 +335,11 @@ +@@ -325,9 +335,11 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; @@ -72,7 +72,7 @@ if (family == AF_UNIX) { if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) -@@ -836,7 +848,10 @@ +@@ -853,7 +865,10 @@ int remote_connect(const char *host, const char *port, struct addrinfo hints) { struct addrinfo *res, *res0; @@ -84,7 +84,7 @@ if ((error = getaddrinfo(host, port, &hints, &res0))) errx(1, "getaddrinfo: %s", gai_strerror(error)); -@@ -850,8 +865,10 @@ +@@ -867,8 +882,10 @@ remote_connect(const char *host, const c if (sflag || pflag) { struct addrinfo ahints, *ares; @@ -95,7 +95,7 @@ memset(&ahints, 0, sizeof(struct addrinfo)); ahints.ai_family = res->ai_family; ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; -@@ -922,7 +939,10 @@ +@@ -939,7 +956,10 @@ int local_listen(char *host, char *port, struct addrinfo hints) { struct addrinfo *res, *res0; @@ -107,7 +107,7 @@ int error; /* Allow nodename to be null. */ -@@ -943,9 +963,11 @@ +@@ -960,9 +980,11 @@ local_listen(char *host, char *port, str res->ai_protocol)) < 0) continue; @@ -119,7 +119,7 @@ set_common_sockopts(s, res->ai_family); -@@ -1403,11 +1425,13 @@ +@@ -1420,11 +1442,13 @@ set_common_sockopts(int s, int af) { int x = 1; @@ -133,7 +133,7 @@ if (Dflag) { if (setsockopt(s, SOL_SOCKET, SO_DEBUG, &x, sizeof(x)) == -1) -@@ -1444,13 +1468,17 @@ +@@ -1461,13 +1485,17 @@ set_common_sockopts(int s, int af) } if (minttl != -1) { @@ -152,7 +152,7 @@ } } -@@ -1644,14 +1672,22 @@ +@@ -1661,14 +1689,22 @@ help(void) \t-P proxyuser\tUsername for proxy authentication\n\ \t-p port\t Specify local port for remote connects\n\ \t-R CAfile CA bundle\n\ @@ -160,10 +160,10 @@ - \t-S Enable the TCP MD5 signature option\n\ + \t-r Randomize remote ports\n" +#ifdef TCP_MD5SIG -+ "\ ++ "\ + \t-S Enable the TCP MD5 signature option\n" +#endif -+ "\ ++ "\ \t-s source Local source address\n\ \t-T keyword TOS value or TLS options\n\ \t-t Answer TELNET negotiation\n\ @@ -172,10 +172,10 @@ - \t-V rtable Specify alternate routing table\n\ + \t-u UDP mode\n" +#ifdef SO_RTABLE -+ "\ ++ "\ + \t-V rtable Specify alternate routing table\n" +#endif -+ "\ ++ "\ \t-v Verbose\n\ \t-w timeout Timeout for connects and final net reads\n\ \t-X proto Proxy protocol: \"4\", \"5\" (SOCKS) or \"connect\"\n\