Fix patch for netcat.c
This commit is contained in:
parent
b67d365454
commit
7383bf673b
@ -1,5 +1,5 @@
|
|||||||
--- apps/nc/netcat.c.orig Sat Nov 5 14:00:01 2016
|
--- apps/nc/netcat.c.orig 2017-02-07 17:12:34.169650728 +0900
|
||||||
+++ apps/nc/netcat.c Sat Nov 5 15:28:35 2016
|
+++ apps/nc/netcat.c 2017-02-07 17:12:55.465651976 +0900
|
||||||
@@ -65,7 +65,9 @@
|
@@ -65,7 +65,9 @@
|
||||||
#define POLL_NETIN 2
|
#define POLL_NETIN 2
|
||||||
#define POLL_STDOUT 3
|
#define POLL_STDOUT 3
|
||||||
@ -8,9 +8,9 @@
|
|||||||
#define DEFAULT_CA_FILE "/etc/ssl/cert.pem"
|
#define DEFAULT_CA_FILE "/etc/ssl/cert.pem"
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
#define TLS_LEGACY (1 << 1)
|
#define TLS_ALL (1 << 1)
|
||||||
#define TLS_NOVERIFY (1 << 2)
|
#define TLS_NOVERIFY (1 << 2)
|
||||||
@@ -93,9 +95,13 @@
|
@@ -93,9 +95,13 @@ int zflag; /* Port Scan Flag */
|
||||||
int Dflag; /* sodebug */
|
int Dflag; /* sodebug */
|
||||||
int Iflag; /* TCP receive buffer size */
|
int Iflag; /* TCP receive buffer size */
|
||||||
int Oflag; /* TCP send buffer size */
|
int Oflag; /* TCP send buffer size */
|
||||||
@ -24,16 +24,16 @@
|
|||||||
|
|
||||||
int usetls; /* use TLS */
|
int usetls; /* use TLS */
|
||||||
char *Cflag; /* Public cert file */
|
char *Cflag; /* Public cert file */
|
||||||
@@ -148,7 +154,7 @@
|
@@ -148,7 +154,7 @@ main(int argc, char *argv[])
|
||||||
struct servent *sv;
|
struct servent *sv;
|
||||||
socklen_t len;
|
socklen_t len;
|
||||||
struct sockaddr_storage cliaddr;
|
struct sockaddr_storage cliaddr;
|
||||||
- char *proxy;
|
- char *proxy, *proxyport = NULL;
|
||||||
+ char *proxy = NULL;
|
+ char *proxy = NULL, *proxyport = NULL;
|
||||||
const char *errstr, *proxyhost = "", *proxyport = NULL;
|
const char *errstr;
|
||||||
struct addrinfo proxyhints;
|
struct addrinfo proxyhints;
|
||||||
char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE];
|
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':
|
case 'u':
|
||||||
uflag = 1;
|
uflag = 1;
|
||||||
break;
|
break;
|
||||||
@ -48,7 +48,7 @@
|
|||||||
case 'v':
|
case 'v':
|
||||||
vflag = 1;
|
vflag = 1;
|
||||||
break;
|
break;
|
||||||
@@ -299,9 +307,11 @@
|
@@ -299,9 +307,11 @@ main(int argc, char *argv[])
|
||||||
case 'o':
|
case 'o':
|
||||||
oflag = optarg;
|
oflag = optarg;
|
||||||
break;
|
break;
|
||||||
@ -60,7 +60,7 @@
|
|||||||
case 'T':
|
case 'T':
|
||||||
errstr = NULL;
|
errstr = NULL;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
@@ -325,9 +335,11 @@
|
@@ -325,9 +335,11 @@ main(int argc, char *argv[])
|
||||||
argc -= optind;
|
argc -= optind;
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
@ -72,7 +72,7 @@
|
|||||||
|
|
||||||
if (family == AF_UNIX) {
|
if (family == AF_UNIX) {
|
||||||
if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1)
|
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)
|
remote_connect(const char *host, const char *port, struct addrinfo hints)
|
||||||
{
|
{
|
||||||
struct addrinfo *res, *res0;
|
struct addrinfo *res, *res0;
|
||||||
@ -84,7 +84,7 @@
|
|||||||
|
|
||||||
if ((error = getaddrinfo(host, port, &hints, &res0)))
|
if ((error = getaddrinfo(host, port, &hints, &res0)))
|
||||||
errx(1, "getaddrinfo: %s", gai_strerror(error));
|
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) {
|
if (sflag || pflag) {
|
||||||
struct addrinfo ahints, *ares;
|
struct addrinfo ahints, *ares;
|
||||||
|
|
||||||
@ -95,7 +95,7 @@
|
|||||||
memset(&ahints, 0, sizeof(struct addrinfo));
|
memset(&ahints, 0, sizeof(struct addrinfo));
|
||||||
ahints.ai_family = res->ai_family;
|
ahints.ai_family = res->ai_family;
|
||||||
ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM;
|
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)
|
local_listen(char *host, char *port, struct addrinfo hints)
|
||||||
{
|
{
|
||||||
struct addrinfo *res, *res0;
|
struct addrinfo *res, *res0;
|
||||||
@ -107,7 +107,7 @@
|
|||||||
int error;
|
int error;
|
||||||
|
|
||||||
/* Allow nodename to be null. */
|
/* Allow nodename to be null. */
|
||||||
@@ -943,9 +963,11 @@
|
@@ -960,9 +980,11 @@ local_listen(char *host, char *port, str
|
||||||
res->ai_protocol)) < 0)
|
res->ai_protocol)) < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -119,7 +119,7 @@
|
|||||||
|
|
||||||
set_common_sockopts(s, res->ai_family);
|
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;
|
int x = 1;
|
||||||
|
|
||||||
@ -133,7 +133,7 @@
|
|||||||
if (Dflag) {
|
if (Dflag) {
|
||||||
if (setsockopt(s, SOL_SOCKET, SO_DEBUG,
|
if (setsockopt(s, SOL_SOCKET, SO_DEBUG,
|
||||||
&x, sizeof(x)) == -1)
|
&x, sizeof(x)) == -1)
|
||||||
@@ -1444,13 +1468,17 @@
|
@@ -1461,13 +1485,17 @@ set_common_sockopts(int s, int af)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minttl != -1) {
|
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 proxyuser\tUsername for proxy authentication\n\
|
||||||
\t-p port\t Specify local port for remote connects\n\
|
\t-p port\t Specify local port for remote connects\n\
|
||||||
\t-R CAfile CA bundle\n\
|
\t-R CAfile CA bundle\n\
|
||||||
@ -160,10 +160,10 @@
|
|||||||
- \t-S Enable the TCP MD5 signature option\n\
|
- \t-S Enable the TCP MD5 signature option\n\
|
||||||
+ \t-r Randomize remote ports\n"
|
+ \t-r Randomize remote ports\n"
|
||||||
+#ifdef TCP_MD5SIG
|
+#ifdef TCP_MD5SIG
|
||||||
+ "\
|
+ "\
|
||||||
+ \t-S Enable the TCP MD5 signature option\n"
|
+ \t-S Enable the TCP MD5 signature option\n"
|
||||||
+#endif
|
+#endif
|
||||||
+ "\
|
+ "\
|
||||||
\t-s source Local source address\n\
|
\t-s source Local source address\n\
|
||||||
\t-T keyword TOS value or TLS options\n\
|
\t-T keyword TOS value or TLS options\n\
|
||||||
\t-t Answer TELNET negotiation\n\
|
\t-t Answer TELNET negotiation\n\
|
||||||
@ -172,10 +172,10 @@
|
|||||||
- \t-V rtable Specify alternate routing table\n\
|
- \t-V rtable Specify alternate routing table\n\
|
||||||
+ \t-u UDP mode\n"
|
+ \t-u UDP mode\n"
|
||||||
+#ifdef SO_RTABLE
|
+#ifdef SO_RTABLE
|
||||||
+ "\
|
+ "\
|
||||||
+ \t-V rtable Specify alternate routing table\n"
|
+ \t-V rtable Specify alternate routing table\n"
|
||||||
+#endif
|
+#endif
|
||||||
+ "\
|
+ "\
|
||||||
\t-v Verbose\n\
|
\t-v Verbose\n\
|
||||||
\t-w timeout Timeout for connects and final net reads\n\
|
\t-w timeout Timeout for connects and final net reads\n\
|
||||||
\t-X proto Proxy protocol: \"4\", \"5\" (SOCKS) or \"connect\"\n\
|
\t-X proto Proxy protocol: \"4\", \"5\" (SOCKS) or \"connect\"\n\
|
||||||
|
Loading…
x
Reference in New Issue
Block a user