diff options
author | Brent Cook <bcook@openbsd.org> | 2017-03-25 12:03:37 -0500 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2017-03-25 12:03:37 -0500 |
commit | 570717c4888ba20ecb24ef873dd9647caad69685 (patch) | |
tree | ba9e290e2648966864ac938273160a5483bca8a3 | |
parent | cb73e4bef69468aa087ad3a0093e2f6badf9617d (diff) | |
download | portable-570717c4888ba20ecb24ef873dd9647caad69685.tar.gz portable-570717c4888ba20ecb24ef873dd9647caad69685.tar.bz2 portable-570717c4888ba20ecb24ef873dd9647caad69685.zip |
rebase netcat patch
-rw-r--r-- | patches/netcat.c.patch | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/patches/netcat.c.patch b/patches/netcat.c.patch index 8d23e83..4e75bc5 100644 --- a/patches/netcat.c.patch +++ b/patches/netcat.c.patch | |||
@@ -1,5 +1,5 @@ | |||
1 | --- apps/nc/netcat.c.orig 2017-02-07 17:12:34.169650728 +0900 | 1 | --- apps/nc/netcat.c.orig Thu Mar 16 19:26:06 2017 |
2 | +++ apps/nc/netcat.c 2017-02-07 17:12:55.465651976 +0900 | 2 | +++ apps/nc/netcat.c Sat Mar 25 11:17:36 2017 |
3 | @@ -65,7 +65,9 @@ | 3 | @@ -65,7 +65,9 @@ |
4 | #define POLL_NETIN 2 | 4 | #define POLL_NETIN 2 |
5 | #define POLL_STDOUT 3 | 5 | #define POLL_STDOUT 3 |
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #define TLS_ALL (1 << 1) | 11 | #define TLS_ALL (1 << 1) |
12 | #define TLS_NOVERIFY (1 << 2) | 12 | #define TLS_NOVERIFY (1 << 2) |
13 | @@ -93,9 +95,13 @@ int zflag; /* Port Scan Flag */ | 13 | @@ -93,9 +95,13 @@ |
14 | int Dflag; /* sodebug */ | 14 | int Dflag; /* sodebug */ |
15 | int Iflag; /* TCP receive buffer size */ | 15 | int Iflag; /* TCP receive buffer size */ |
16 | int Oflag; /* TCP send buffer size */ | 16 | int Oflag; /* TCP send buffer size */ |
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | int usetls; /* use TLS */ | 25 | int usetls; /* use TLS */ |
26 | char *Cflag; /* Public cert file */ | 26 | char *Cflag; /* Public cert file */ |
27 | @@ -148,7 +154,7 @@ main(int argc, char *argv[]) | 27 | @@ -149,7 +155,7 @@ |
28 | struct servent *sv; | 28 | struct servent *sv; |
29 | socklen_t len; | 29 | socklen_t len; |
30 | struct sockaddr_storage cliaddr; | 30 | struct sockaddr_storage cliaddr; |
@@ -33,7 +33,7 @@ | |||
33 | const char *errstr; | 33 | const char *errstr; |
34 | struct addrinfo proxyhints; | 34 | struct addrinfo proxyhints; |
35 | char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; | 35 | char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; |
36 | @@ -258,12 +264,14 @@ main(int argc, char *argv[]) | 36 | @@ -259,12 +265,14 @@ |
37 | case 'u': | 37 | case 'u': |
38 | uflag = 1; | 38 | uflag = 1; |
39 | break; | 39 | break; |
@@ -48,7 +48,7 @@ | |||
48 | case 'v': | 48 | case 'v': |
49 | vflag = 1; | 49 | vflag = 1; |
50 | break; | 50 | break; |
51 | @@ -299,9 +307,11 @@ main(int argc, char *argv[]) | 51 | @@ -300,9 +308,11 @@ |
52 | case 'o': | 52 | case 'o': |
53 | oflag = optarg; | 53 | oflag = optarg; |
54 | break; | 54 | break; |
@@ -60,7 +60,7 @@ | |||
60 | case 'T': | 60 | case 'T': |
61 | errstr = NULL; | 61 | errstr = NULL; |
62 | errno = 0; | 62 | errno = 0; |
63 | @@ -325,9 +335,11 @@ main(int argc, char *argv[]) | 63 | @@ -326,9 +336,11 @@ |
64 | argc -= optind; | 64 | argc -= optind; |
65 | argv += optind; | 65 | argv += optind; |
66 | 66 | ||
@@ -72,7 +72,7 @@ | |||
72 | 72 | ||
73 | if (family == AF_UNIX) { | 73 | if (family == AF_UNIX) { |
74 | if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) | 74 | if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) |
75 | @@ -853,7 +865,10 @@ int | 75 | @@ -865,7 +877,10 @@ |
76 | remote_connect(const char *host, const char *port, struct addrinfo hints) | 76 | remote_connect(const char *host, const char *port, struct addrinfo hints) |
77 | { | 77 | { |
78 | struct addrinfo *res, *res0; | 78 | struct addrinfo *res, *res0; |
@@ -83,8 +83,8 @@ | |||
83 | +#endif | 83 | +#endif |
84 | 84 | ||
85 | if ((error = getaddrinfo(host, port, &hints, &res0))) | 85 | if ((error = getaddrinfo(host, port, &hints, &res0))) |
86 | errx(1, "getaddrinfo: %s", gai_strerror(error)); | 86 | errx(1, "getaddrinfo for host \"%s\" port %s: %s", host, |
87 | @@ -867,8 +882,10 @@ remote_connect(const char *host, const c | 87 | @@ -880,8 +895,10 @@ |
88 | if (sflag || pflag) { | 88 | if (sflag || pflag) { |
89 | struct addrinfo ahints, *ares; | 89 | struct addrinfo ahints, *ares; |
90 | 90 | ||
@@ -95,7 +95,7 @@ | |||
95 | memset(&ahints, 0, sizeof(struct addrinfo)); | 95 | memset(&ahints, 0, sizeof(struct addrinfo)); |
96 | ahints.ai_family = res->ai_family; | 96 | ahints.ai_family = res->ai_family; |
97 | ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; | 97 | ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; |
98 | @@ -939,7 +956,10 @@ int | 98 | @@ -952,7 +969,10 @@ |
99 | local_listen(char *host, char *port, struct addrinfo hints) | 99 | local_listen(char *host, char *port, struct addrinfo hints) |
100 | { | 100 | { |
101 | struct addrinfo *res, *res0; | 101 | struct addrinfo *res, *res0; |
@@ -107,7 +107,7 @@ | |||
107 | int error; | 107 | int error; |
108 | 108 | ||
109 | /* Allow nodename to be null. */ | 109 | /* Allow nodename to be null. */ |
110 | @@ -960,9 +980,11 @@ local_listen(char *host, char *port, str | 110 | @@ -973,9 +993,11 @@ |
111 | res->ai_protocol)) < 0) | 111 | res->ai_protocol)) < 0) |
112 | continue; | 112 | continue; |
113 | 113 | ||
@@ -119,7 +119,7 @@ | |||
119 | 119 | ||
120 | set_common_sockopts(s, res->ai_family); | 120 | set_common_sockopts(s, res->ai_family); |
121 | 121 | ||
122 | @@ -1420,11 +1442,13 @@ set_common_sockopts(int s, int af) | 122 | @@ -1425,11 +1447,13 @@ |
123 | { | 123 | { |
124 | int x = 1; | 124 | int x = 1; |
125 | 125 | ||
@@ -133,7 +133,7 @@ | |||
133 | if (Dflag) { | 133 | if (Dflag) { |
134 | if (setsockopt(s, SOL_SOCKET, SO_DEBUG, | 134 | if (setsockopt(s, SOL_SOCKET, SO_DEBUG, |
135 | &x, sizeof(x)) == -1) | 135 | &x, sizeof(x)) == -1) |
136 | @@ -1461,13 +1485,17 @@ set_common_sockopts(int s, int af) | 136 | @@ -1466,13 +1490,17 @@ |
137 | } | 137 | } |
138 | 138 | ||
139 | if (minttl != -1) { | 139 | if (minttl != -1) { |
@@ -152,7 +152,7 @@ | |||
152 | } | 152 | } |
153 | } | 153 | } |
154 | 154 | ||
155 | @@ -1661,14 +1689,22 @@ help(void) | 155 | @@ -1666,14 +1694,22 @@ |
156 | \t-P proxyuser\tUsername for proxy authentication\n\ | 156 | \t-P proxyuser\tUsername for proxy authentication\n\ |
157 | \t-p port\t Specify local port for remote connects\n\ | 157 | \t-p port\t Specify local port for remote connects\n\ |
158 | \t-R CAfile CA bundle\n\ | 158 | \t-R CAfile CA bundle\n\ |