From c31b03c1d4a14d25fe43219a9158ad96444809e4 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Fri, 23 Oct 2015 16:17:45 -0700 Subject: update netcat patch --- patches/netcat.c.patch | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/patches/netcat.c.patch b/patches/netcat.c.patch index 7200183..36278d9 100644 --- a/patches/netcat.c.patch +++ b/patches/netcat.c.patch @@ -1,5 +1,5 @@ ---- apps/nc/netcat.c.orig 2015-10-14 15:39:27.000000000 +0900 -+++ apps/nc/netcat.c 2015-10-14 15:42:35.000000000 +0900 +--- apps/nc/netcat.c.orig 2015-10-23 16:01:14.000000000 -0700 ++++ apps/nc/netcat.c 2015-10-23 16:17:08.000000000 -0700 @@ -57,6 +57,10 @@ #include #include "atomicio.h" @@ -61,7 +61,26 @@ case 'T': errstr = NULL; errno = 0; -@@ -771,7 +783,10 @@ +@@ -310,14 +322,16 @@ + argc -= optind; + argv += optind; + ++#ifdef SO_RTABLE + if (rtableid >= 0) { + /* + * XXX No pledge if doing rtable manipulation! + * XXX the routing table stuff is dangerous and can't be pledged. + * XXX rtable should really have a better interface than sockopt + */ +- } +- else if (family == AF_UNIX) { ++ } else ++#endif ++ if (family == AF_UNIX) { + if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) + err(1, "pledge"); + } +@@ -797,7 +811,10 @@ remote_connect(const char *host, const char *port, struct addrinfo hints) { struct addrinfo *res, *res0; @@ -73,7 +92,7 @@ if ((error = getaddrinfo(host, port, &hints, &res))) errx(1, "getaddrinfo: %s", gai_strerror(error)); -@@ -782,16 +797,20 @@ +@@ -808,16 +825,20 @@ SOCK_NONBLOCK, res0->ai_protocol)) < 0) continue; @@ -94,7 +113,7 @@ memset(&ahints, 0, sizeof(struct addrinfo)); ahints.ai_family = res0->ai_family; ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; -@@ -860,7 +879,10 @@ +@@ -886,7 +907,10 @@ local_listen(char *host, char *port, struct addrinfo hints) { struct addrinfo *res, *res0; @@ -106,7 +125,7 @@ int error; /* Allow nodename to be null. */ -@@ -882,13 +904,17 @@ +@@ -908,13 +932,17 @@ res0->ai_protocol)) < 0) continue; @@ -124,7 +143,7 @@ set_common_sockopts(s, res0->ai_family); -@@ -1332,11 +1358,13 @@ +@@ -1358,11 +1386,13 @@ { int x = 1; @@ -138,7 +157,7 @@ if (Dflag) { if (setsockopt(s, SOL_SOCKET, SO_DEBUG, &x, sizeof(x)) == -1) -@@ -1511,15 +1539,19 @@ +@@ -1537,15 +1567,19 @@ \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\ -- cgit v1.2.3-55-g6feb