diff options
author | Brent Cook <bcook@rapid7.com> | 2015-10-23 16:17:45 -0700 |
---|---|---|
committer | Brent Cook <bcook@rapid7.com> | 2015-10-23 16:17:45 -0700 |
commit | c31b03c1d4a14d25fe43219a9158ad96444809e4 (patch) | |
tree | a2d7c6bee3a2a827e61748fb6f9b2488f262cbf8 | |
parent | 9be9055791b49415765ff8ea8841a226d7207d0d (diff) | |
download | portable-c31b03c1d4a14d25fe43219a9158ad96444809e4.tar.gz portable-c31b03c1d4a14d25fe43219a9158ad96444809e4.tar.bz2 portable-c31b03c1d4a14d25fe43219a9158ad96444809e4.zip |
update netcat patch
-rw-r--r-- | patches/netcat.c.patch | 35 |
1 files 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 @@ | |||
1 | --- apps/nc/netcat.c.orig 2015-10-14 15:39:27.000000000 +0900 | 1 | --- apps/nc/netcat.c.orig 2015-10-23 16:01:14.000000000 -0700 |
2 | +++ apps/nc/netcat.c 2015-10-14 15:42:35.000000000 +0900 | 2 | +++ apps/nc/netcat.c 2015-10-23 16:17:08.000000000 -0700 |
3 | @@ -57,6 +57,10 @@ | 3 | @@ -57,6 +57,10 @@ |
4 | #include <tls.h> | 4 | #include <tls.h> |
5 | #include "atomicio.h" | 5 | #include "atomicio.h" |
@@ -61,7 +61,26 @@ | |||
61 | case 'T': | 61 | case 'T': |
62 | errstr = NULL; | 62 | errstr = NULL; |
63 | errno = 0; | 63 | errno = 0; |
64 | @@ -771,7 +783,10 @@ | 64 | @@ -310,14 +322,16 @@ |
65 | argc -= optind; | ||
66 | argv += optind; | ||
67 | |||
68 | +#ifdef SO_RTABLE | ||
69 | if (rtableid >= 0) { | ||
70 | /* | ||
71 | * XXX No pledge if doing rtable manipulation! | ||
72 | * XXX the routing table stuff is dangerous and can't be pledged. | ||
73 | * XXX rtable should really have a better interface than sockopt | ||
74 | */ | ||
75 | - } | ||
76 | - else if (family == AF_UNIX) { | ||
77 | + } else | ||
78 | +#endif | ||
79 | + if (family == AF_UNIX) { | ||
80 | if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) | ||
81 | err(1, "pledge"); | ||
82 | } | ||
83 | @@ -797,7 +811,10 @@ | ||
65 | remote_connect(const char *host, const char *port, struct addrinfo hints) | 84 | remote_connect(const char *host, const char *port, struct addrinfo hints) |
66 | { | 85 | { |
67 | struct addrinfo *res, *res0; | 86 | struct addrinfo *res, *res0; |
@@ -73,7 +92,7 @@ | |||
73 | 92 | ||
74 | if ((error = getaddrinfo(host, port, &hints, &res))) | 93 | if ((error = getaddrinfo(host, port, &hints, &res))) |
75 | errx(1, "getaddrinfo: %s", gai_strerror(error)); | 94 | errx(1, "getaddrinfo: %s", gai_strerror(error)); |
76 | @@ -782,16 +797,20 @@ | 95 | @@ -808,16 +825,20 @@ |
77 | SOCK_NONBLOCK, res0->ai_protocol)) < 0) | 96 | SOCK_NONBLOCK, res0->ai_protocol)) < 0) |
78 | continue; | 97 | continue; |
79 | 98 | ||
@@ -94,7 +113,7 @@ | |||
94 | memset(&ahints, 0, sizeof(struct addrinfo)); | 113 | memset(&ahints, 0, sizeof(struct addrinfo)); |
95 | ahints.ai_family = res0->ai_family; | 114 | ahints.ai_family = res0->ai_family; |
96 | ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; | 115 | ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; |
97 | @@ -860,7 +879,10 @@ | 116 | @@ -886,7 +907,10 @@ |
98 | local_listen(char *host, char *port, struct addrinfo hints) | 117 | local_listen(char *host, char *port, struct addrinfo hints) |
99 | { | 118 | { |
100 | struct addrinfo *res, *res0; | 119 | struct addrinfo *res, *res0; |
@@ -106,7 +125,7 @@ | |||
106 | int error; | 125 | int error; |
107 | 126 | ||
108 | /* Allow nodename to be null. */ | 127 | /* Allow nodename to be null. */ |
109 | @@ -882,13 +904,17 @@ | 128 | @@ -908,13 +932,17 @@ |
110 | res0->ai_protocol)) < 0) | 129 | res0->ai_protocol)) < 0) |
111 | continue; | 130 | continue; |
112 | 131 | ||
@@ -124,7 +143,7 @@ | |||
124 | 143 | ||
125 | set_common_sockopts(s, res0->ai_family); | 144 | set_common_sockopts(s, res0->ai_family); |
126 | 145 | ||
127 | @@ -1332,11 +1358,13 @@ | 146 | @@ -1358,11 +1386,13 @@ |
128 | { | 147 | { |
129 | int x = 1; | 148 | int x = 1; |
130 | 149 | ||
@@ -138,7 +157,7 @@ | |||
138 | if (Dflag) { | 157 | if (Dflag) { |
139 | if (setsockopt(s, SOL_SOCKET, SO_DEBUG, | 158 | if (setsockopt(s, SOL_SOCKET, SO_DEBUG, |
140 | &x, sizeof(x)) == -1) | 159 | &x, sizeof(x)) == -1) |
141 | @@ -1511,15 +1539,19 @@ | 160 | @@ -1537,15 +1567,19 @@ |
142 | \t-P proxyuser\tUsername for proxy authentication\n\ | 161 | \t-P proxyuser\tUsername for proxy authentication\n\ |
143 | \t-p port\t Specify local port for remote connects\n\ | 162 | \t-p port\t Specify local port for remote connects\n\ |
144 | \t-R CAfile CA bundle\n\ | 163 | \t-R CAfile CA bundle\n\ |