Hello community,

here is the log from the commit of package netcat-openbsd for openSUSE:Factory 
checked in at 2019-09-19 15:46:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/netcat-openbsd (Old)
 and      /work/SRC/openSUSE:Factory/.netcat-openbsd.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "netcat-openbsd"

Thu Sep 19 15:46:22 2019 rev:25 rq:729549 version:1.203

Changes:
--------
--- /work/SRC/openSUSE:Factory/netcat-openbsd/netcat-openbsd.changes    
2018-11-26 10:16:05.302029033 +0100
+++ /work/SRC/openSUSE:Factory/.netcat-openbsd.new.7948/netcat-openbsd.changes  
2019-09-19 15:46:28.903346505 +0200
@@ -1,0 +2,21 @@
+Mon Sep  9 18:48:35 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 1.203 matching debian
+- Remove patch verbose-numeric-port.patch
+- Refresh patches:
+  * broadcast-support.patch
+  * build-without-TLS-support.patch
+  * connect-timeout.patch
+  * dccp-support.patch
+  * destination-port-list.patch
+  * get-sev-by-name.patch
+  * misc-failures-and-features.patch
+  * port-to-linux-with-libsd.patch
+  * quit-timer.patch
+  * send-crlf.patch
+  * serialized-handling-multiple-clients.patch
+  * set-TCP-MD5SIG-correctly-for-client-connections.patch
+  * udp-scan-timeout.patch
+  * use-flags-to-specify-listen-address.patch
+
+-------------------------------------------------------------------

Old:
----
  netcat-openbsd_1.195.orig.tar.gz
  verbose-numeric-port.patch

New:
----
  netcat-openbsd_1.203.orig.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ netcat-openbsd.spec ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:29.903346302 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:29.919346298 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package netcat-openbsd
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,14 +17,14 @@
 
 
 Name:           netcat-openbsd
-Version:        1.195
+Version:        1.203
 Release:        0
 Summary:        TCP/IP swiss army knife
 License:        BSD-3-Clause
 Group:          Productivity/Networking/Other
-URL:            http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/
+URL:            https://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/
 Source0:        
http://http.debian.net/debian/pool/main/n/netcat-openbsd/netcat-openbsd_%{version}.orig.tar.gz
-#Patches from: 
http://http.debian.net/debian/pool/main/n/netcat-openbsd/netcat-openbsd_%{version}-1.debian.tar.xz
+#Patches from: 
http://http.debian.net/debian/pool/main/n/netcat-openbsd/netcat-openbsd_%{version}-2.debian.tar.xz
 Patch0:         port-to-linux-with-libsd.patch
 Patch1:         build-without-TLS-support.patch
 Patch2:         connect-timeout.patch
@@ -32,14 +32,13 @@
 Patch4:         send-crlf.patch
 Patch5:         quit-timer.patch
 Patch6:         udp-scan-timeout.patch
-Patch7:         verbose-numeric-port.patch
-Patch8:         dccp-support.patch
-Patch9:         broadcast-support.patch
-Patch10:        serialized-handling-multiple-clients.patch
-Patch11:        set-TCP-MD5SIG-correctly-for-client-connections.patch
-Patch12:        destination-port-list.patch
-Patch13:        use-flags-to-specify-listen-address.patch
-Patch14:        misc-failures-and-features.patch
+Patch7:         dccp-support.patch
+Patch8:         broadcast-support.patch
+Patch9:         serialized-handling-multiple-clients.patch
+Patch10:        set-TCP-MD5SIG-correctly-for-client-connections.patch
+Patch11:        destination-port-list.patch
+Patch12:        use-flags-to-specify-listen-address.patch
+Patch13:        misc-failures-and-features.patch
 BuildRequires:  pkgconfig
 BuildRequires:  pkgconfig(libbsd)
 Provides:       nc6 = %{version}

++++++ broadcast-support.patch ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:29.959346290 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:29.959346290 +0200
@@ -29,7 +29,7 @@
  data is translated into CR+LF before being written to the socket.  Line
 --- a/netcat.c
 +++ b/netcat.c
-@@ -133,6 +133,7 @@
+@@ -132,6 +132,7 @@
  #define UDP_SCAN_TIMEOUT 3                    /* Seconds */
  
  /* Command Line Options */
@@ -37,7 +37,7 @@
  int   dflag;                                  /* detached, no stdin */
  int   Fflag;                                  /* fdpass sock to stdout */
  unsigned int iflag;                           /* Interval Flag */
-@@ -261,9 +262,9 @@ main(int argc, char *argv[])
+@@ -263,9 +264,9 @@ main(int argc, char *argv[])
  
        while ((ch = getopt(argc, argv,
  # if defined(TLS)
@@ -49,7 +49,7 @@
  # endif
            != -1) {
                switch (ch) {
-@@ -273,6 +274,13 @@ main(int argc, char *argv[])
+@@ -275,6 +276,13 @@ main(int argc, char *argv[])
                case '6':
                        family = AF_INET6;
                        break;
@@ -63,7 +63,7 @@
                case 'U':
                        family = AF_UNIX;
                        break;
-@@ -1843,6 +1851,15 @@ set_common_sockopts(int s, int af)
+@@ -1852,6 +1860,15 @@ set_common_sockopts(int s, int af)
  {
        int x = 1;
  
@@ -79,7 +79,7 @@
  # if defined(TCP_MD5SIG)
        if (Sflag) {
                if (setsockopt(s, IPPROTO_TCP, TCP_MD5SIG,
-@@ -2122,6 +2139,7 @@ help(void)
+@@ -2127,6 +2144,7 @@ help(void)
        fprintf(stderr, "\tCommand Summary:\n\
        \t-4            Use IPv4\n\
        \t-6            Use IPv6\n\

++++++ build-without-TLS-support.patch ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:29.979346286 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:29.979346286 +0200
@@ -9,7 +9,7 @@
  Makefile |    2 
  nc.1     |  114 ++---------------------------------------
  netcat.c |  172 
+++++++++++++++++++++++++++++++++++++++++++++++++++++----------
- 3 files changed, 152 insertions(+), 136 deletions(-)
+ 3 files changed, 153 insertions(+), 135 deletions(-)
 
 --- a/Makefile
 +++ b/Makefile
@@ -232,7 +232,7 @@
  .Dl $ nc -u host.example.com 53
 --- a/netcat.c
 +++ b/netcat.c
-@@ -98,7 +98,9 @@
+@@ -99,7 +99,9 @@
  #include <stdlib.h>
  #include <string.h>
  #include <time.h>
@@ -243,18 +243,15 @@
  #include <unistd.h>
  #include <bsd/stdlib.h>
  #include <bsd/string.h>
-@@ -113,12 +115,14 @@
- #define POLL_NETIN    2
+@@ -115,10 +117,12 @@
  #define POLL_STDOUT   3
  #define BUFSIZE               16384
--#define DEFAULT_CA_FILE       "/etc/ssl/cert.pem"
-+#ifdef TLS
-+# define DEFAULT_CA_FILE      "/etc/ssl/cert.pem"
  
 -#define TLS_NOVERIFY  (1 << 1)
 -#define TLS_NONAME    (1 << 2)
 -#define TLS_CCERT     (1 << 3)
 -#define TLS_MUSTSTAPLE        (1 << 4)
++#ifdef TLS
 +# define TLS_NOVERIFY (1 << 1)
 +# define TLS_NONAME   (1 << 2)
 +# define TLS_CCERT    (1 << 3)
@@ -269,8 +266,8 @@
  
 +# if defined(TLS)
  int   usetls;                                 /* use TLS */
- char    *Cflag;                                       /* Public cert file */
- char    *Kflag;                                       /* Private key file */
+ const char    *Cflag;                         /* Public cert file */
+ const char    *Kflag;                         /* Private key file */
 @@ -156,6 +161,7 @@ char       *tls_expecthash;                        /* 
required hash
  char  *tls_ciphers;                           /* TLS ciphers */
  char  *tls_protocols;                         /* TLS protocols */
@@ -304,7 +301,7 @@
  int   process_tls_opt(char *, int *);
  void  save_peer_cert(struct tls *_tls_ctx, FILE *_fp);
 +# endif
- void  report_connect(const struct sockaddr *, socklen_t, char *);
+ void  report_sock(const char *, const struct sockaddr *, socklen_t, char *);
 +# if defined(TLS)
  void  report_tls(struct tls *tls_ctx, char * host);
 +# endif
@@ -332,7 +329,14 @@
        uint32_t protocols;
  
        ret = 1;
-@@ -219,7 +242,11 @@ main(int argc, char *argv[])
+@@ -215,12 +238,18 @@ main(int argc, char *argv[])
+       host = NULL;
+       uport = NULL;
+       sv = NULL;
++# if defined(TLS)
+       Rflag = tls_default_ca_cert_file();
++# endif
+ 
        signal(SIGPIPE, SIG_IGN);
  
        while ((ch = getopt(argc, argv,
@@ -344,7 +348,7 @@
            != -1) {
                switch (ch) {
                case '4':
-@@ -241,24 +268,30 @@ main(int argc, char *argv[])
+@@ -242,24 +271,30 @@ main(int argc, char *argv[])
                        else
                                errx(1, "unsupported proxy protocol");
                        break;
@@ -375,7 +379,7 @@
                case 'h':
                        help();
                        break;
-@@ -267,9 +300,11 @@ main(int argc, char *argv[])
+@@ -268,9 +303,11 @@ main(int argc, char *argv[])
                        if (errstr)
                                errx(1, "interval %s: %s", errstr, optarg);
                        break;
@@ -387,7 +391,7 @@
                case 'k':
                        kflag = 1;
                        break;
-@@ -298,10 +333,12 @@ main(int argc, char *argv[])
+@@ -299,10 +336,12 @@ main(int argc, char *argv[])
                case 'p':
                        pflag = optarg;
                        break;
@@ -400,7 +404,7 @@
                case 'r':
                        rflag = 1;
                        break;
-@@ -343,12 +380,14 @@ main(int argc, char *argv[])
+@@ -344,12 +383,14 @@ main(int argc, char *argv[])
                        if ((proxy = strdup(optarg)) == NULL)
                                err(1, NULL);
                        break;
@@ -415,7 +419,7 @@
                case 'z':
                        zflag = 1;
                        break;
-@@ -367,9 +406,11 @@ main(int argc, char *argv[])
+@@ -368,9 +409,11 @@ main(int argc, char *argv[])
                                errx(1, "TCP send window %s: %s",
                                    errstr, optarg);
                        break;
@@ -427,7 +431,7 @@
                case 'S':
  # if defined(TCP_MD5SIG)
                        Sflag = 1;
-@@ -380,8 +421,10 @@ main(int argc, char *argv[])
+@@ -381,8 +424,10 @@ main(int argc, char *argv[])
                case 'T':
                        errstr = NULL;
                        errno = 0;
@@ -438,7 +442,7 @@
                        if (process_tos_opt(optarg, &Tflag))
                                break;
                        if (strlen(optarg) > 1 && optarg[0] == '0' &&
-@@ -391,7 +434,11 @@ main(int argc, char *argv[])
+@@ -392,7 +437,11 @@ main(int argc, char *argv[])
                                Tflag = (int)strtonum(optarg, 0, 255,
                                    &errstr);
                        if (Tflag < 0 || Tflag > 255 || errstr || errno)
@@ -450,7 +454,7 @@
                        break;
                default:
                        usage(1);
-@@ -428,6 +475,7 @@ main(int argc, char *argv[])
+@@ -429,6 +478,7 @@ main(int argc, char *argv[])
        } else
                usage(1);
  
@@ -458,7 +462,7 @@
        if (usetls) {
                if (Cflag && unveil(Cflag, "r") == -1)
                        err(1, "unveil");
-@@ -450,15 +498,19 @@ main(int argc, char *argv[])
+@@ -451,15 +501,19 @@ main(int argc, char *argv[])
                                err(1, "unveil");
                }
        }
@@ -478,7 +482,7 @@
        if (Fflag && usetls)
                errx(1, "cannot use -c and -F");
        if (TLSopt && !usetls)
-@@ -477,6 +529,7 @@ main(int argc, char *argv[])
+@@ -478,6 +532,7 @@ main(int argc, char *argv[])
                errx(1, "you must specify -c to use -H");
        if (tls_expectname && !usetls)
                errx(1, "you must specify -c to use -e");
@@ -486,7 +490,7 @@
  
        /* Get name of temporary socket for unix datagram client */
        if ((family == AF_UNIX) && uflag && !lflag) {
-@@ -543,6 +596,7 @@ main(int argc, char *argv[])
+@@ -544,6 +599,7 @@ main(int argc, char *argv[])
                        proxyhints.ai_flags |= AI_NUMERICHOST;
        }
  
@@ -494,7 +498,7 @@
        if (usetls) {
                if ((tls_cfg = tls_config_new()) == NULL)
                        errx(1, "unable to allocate TLS config");
-@@ -578,7 +632,8 @@ main(int argc, char *argv[])
+@@ -579,7 +635,8 @@ main(int argc, char *argv[])
                                err(1, "pledge");
                } else if (pledge("stdio inet dns", NULL) == -1)
                        err(1, "pledge");
@@ -504,7 +508,7 @@
        if (lflag) {
                ret = 0;
  
-@@ -589,6 +644,7 @@ main(int argc, char *argv[])
+@@ -590,6 +647,7 @@ main(int argc, char *argv[])
                                s = unix_listen(host);
                }
  
@@ -512,7 +516,7 @@
                if (usetls) {
                        tls_config_verify_client_optional(tls_cfg);
                        if ((tls_ctx = tls_server()) == NULL)
-@@ -597,6 +653,7 @@ main(int argc, char *argv[])
+@@ -598,6 +656,7 @@ main(int argc, char *argv[])
                                errx(1, "tls configuration failed (%s)",
                                    tls_error(tls_ctx));
                }
@@ -520,7 +524,7 @@
                /* Allow only one connection at a time, but stay alive. */
                for (;;) {
                        if (family != AF_UNIX) {
-@@ -612,7 +669,11 @@ main(int argc, char *argv[])
+@@ -613,7 +672,11 @@ main(int argc, char *argv[])
                                 * let it receive datagrams from multiple
                                 * socket pairs.
                                 */
@@ -532,9 +536,9 @@
                        } else if (uflag && !kflag) {
                                /*
                                 * For UDP and not -k, we will use recvfrom()
-@@ -636,9 +697,14 @@ main(int argc, char *argv[])
-                               if (vflag)
-                                       report_connect((struct sockaddr *)&z, 
len, NULL);
+@@ -638,9 +701,14 @@ main(int argc, char *argv[])
+                                       report_sock("Connection received",
+                                           (struct sockaddr *)&z, len, NULL);
  
 +# if defined(TLS)
                                readwrite(s, NULL);
@@ -547,15 +551,15 @@
                                int connfd;
  
                                len = sizeof(cliaddr);
-@@ -651,6 +717,7 @@ main(int argc, char *argv[])
-                               if (vflag)
-                                       report_connect((struct sockaddr 
*)&cliaddr, len,
+@@ -654,6 +722,7 @@ main(int argc, char *argv[])
+                                       report_sock("Connection received",
+                                           (struct sockaddr *)&cliaddr, len,
                                            family == AF_UNIX ? host : NULL);
 +# if defined(TLS)
                                if ((usetls) &&
                                    (tls_cctx = tls_setup_server(tls_ctx, 
connfd, host)))
                                        readwrite(connfd, tls_cctx);
-@@ -660,6 +727,10 @@ main(int argc, char *argv[])
+@@ -663,6 +732,10 @@ main(int argc, char *argv[])
                                        timeout_tls(s, tls_cctx, tls_close);
                                close(connfd);
                                tls_free(tls_cctx);
@@ -566,7 +570,7 @@
                        }
                        if (family == AF_UNIX && uflag) {
                                if (connect(s, NULL, 0) < 0)
-@@ -674,7 +745,11 @@ main(int argc, char *argv[])
+@@ -677,7 +750,11 @@ main(int argc, char *argv[])
  
                if ((s = unix_connect(host)) > 0) {
                        if (!zflag)
@@ -576,9 +580,9 @@
 +                              readwrite(s);
 +# endif
                        close(s);
-               } else
-                       ret = 1;
-@@ -693,6 +768,7 @@ main(int argc, char *argv[])
+               } else {
+                       warn("%s", host);
+@@ -698,6 +775,7 @@ main(int argc, char *argv[])
                for (s = -1, i = 0; portlist[i] != NULL; i++) {
                        if (s != -1)
                                close(s);
@@ -586,7 +590,7 @@
                        tls_free(tls_ctx);
                        tls_ctx = NULL;
  
-@@ -703,6 +779,7 @@ main(int argc, char *argv[])
+@@ -708,6 +786,7 @@ main(int argc, char *argv[])
                                        errx(1, "tls configuration failed (%s)",
                                            tls_error(tls_ctx));
                        }
@@ -594,7 +598,7 @@
                        if (xflag)
                                s = socks_connect(host, portlist[i], hints,
                                    proxy, proxyport, proxyhints, socksv,
-@@ -740,6 +817,7 @@ main(int argc, char *argv[])
+@@ -745,6 +824,7 @@ main(int argc, char *argv[])
                        }
                        if (Fflag)
                                fdpass(s);
@@ -602,7 +606,7 @@
                        else {
                                if (usetls)
                                        tls_setup_client(tls_ctx, s, host);
-@@ -748,13 +826,19 @@ main(int argc, char *argv[])
+@@ -753,13 +833,19 @@ main(int argc, char *argv[])
                                if (tls_ctx)
                                        timeout_tls(s, tls_ctx, tls_close);
                        }
@@ -622,7 +626,7 @@
  
        return ret;
  }
-@@ -794,6 +878,7 @@ unix_bind(char *path, int flags)
+@@ -801,6 +887,7 @@ unix_bind(char *path, int flags)
        return s;
  }
  
@@ -630,7 +634,7 @@
  int
  timeout_tls(int s, struct tls *tls_ctx, int (*func)(struct tls *))
  {
-@@ -880,6 +965,7 @@ tls_setup_server(struct tls *tls_ctx, in
+@@ -887,6 +974,7 @@ tls_setup_server(struct tls *tls_ctx, in
        }
        return NULL;
  }
@@ -638,7 +642,7 @@
  
  /*
   * unix_connect()
-@@ -1092,7 +1178,11 @@ local_listen(const char *host, const cha
+@@ -1112,7 +1200,11 @@ local_listen(const char *host, const cha
   * Loop that polls on the network file descriptor and stdin.
   */
  void
@@ -650,7 +654,7 @@
  {
        struct pollfd pfd[4];
        int stdin_fd = STDIN_FILENO;
-@@ -1192,12 +1282,17 @@ readwrite(int net_fd, struct tls *tls_ct
+@@ -1212,12 +1304,17 @@ readwrite(int net_fd, struct tls *tls_ct
                /* try to read from stdin */
                if (pfd[POLL_STDIN].revents & POLLIN && stdinbufpos < BUFSIZE) {
                        ret = fillbuf(pfd[POLL_STDIN].fd, stdinbuf,
@@ -669,7 +673,7 @@
                                pfd[POLL_STDIN].fd = -1;
                        /* read something - poll net out */
                        if (stdinbufpos > 0)
-@@ -1209,12 +1304,17 @@ readwrite(int net_fd, struct tls *tls_ct
+@@ -1229,12 +1326,17 @@ readwrite(int net_fd, struct tls *tls_ct
                /* try to write to network */
                if (pfd[POLL_NETOUT].revents & POLLOUT && stdinbufpos > 0) {
                        ret = drainbuf(pfd[POLL_NETOUT].fd, stdinbuf,
@@ -688,7 +692,7 @@
                                pfd[POLL_NETOUT].fd = -1;
                        /* buffer empty - remove self from polling */
                        if (stdinbufpos == 0)
-@@ -1226,12 +1326,17 @@ readwrite(int net_fd, struct tls *tls_ct
+@@ -1246,12 +1348,17 @@ readwrite(int net_fd, struct tls *tls_ct
                /* try to read from network */
                if (pfd[POLL_NETIN].revents & POLLIN && netinbufpos < BUFSIZE) {
                        ret = fillbuf(pfd[POLL_NETIN].fd, netinbuf,
@@ -707,7 +711,7 @@
                                pfd[POLL_NETIN].fd = -1;
                        /* eof on net in - remove from pfd */
                        if (ret == 0) {
-@@ -1258,12 +1363,17 @@ readwrite(int net_fd, struct tls *tls_ct
+@@ -1278,12 +1385,17 @@ readwrite(int net_fd, struct tls *tls_ct
                /* try to write to stdout */
                if (pfd[POLL_STDOUT].revents & POLLOUT && netinbufpos > 0) {
                        ret = drainbuf(pfd[POLL_STDOUT].fd, netinbuf,
@@ -726,7 +730,7 @@
                                pfd[POLL_STDOUT].fd = -1;
                        /* buffer empty - remove self from polling */
                        if (netinbufpos == 0)
-@@ -1287,19 +1397,29 @@ readwrite(int net_fd, struct tls *tls_ct
+@@ -1307,21 +1419,31 @@ readwrite(int net_fd, struct tls *tls_ct
  }
  
  ssize_t
@@ -740,9 +744,11 @@
        ssize_t adjust;
  
 +# if defined(TLS)
-       if (tls)
+       if (tls) {
                n = tls_write(tls, buf, *bufpos);
-       else {
+               if (n == -1)
+                       errx(1, "tls write failed (%s)", tls_error(tls));
+       } else {
 +# endif
                n = write(fd, buf, *bufpos);
                /* don't treat EAGAIN, EINTR as error */
@@ -756,7 +762,7 @@
        if (n <= 0)
                return n;
        /* adjust buffer */
-@@ -1311,19 +1431,29 @@ drainbuf(int fd, unsigned char *buf, siz
+@@ -1333,21 +1455,31 @@ drainbuf(int fd, unsigned char *buf, siz
  }
  
  ssize_t
@@ -770,9 +776,11 @@
        ssize_t n;
  
 +# if defined(TLS)
-       if (tls)
+       if (tls) {
                n = tls_read(tls, buf + *bufpos, num);
-       else {
+               if (n == -1)
+                       errx(1, "tls read failed (%s)", tls_error(tls));
+       } else {
 +# endif
                n = read(fd, buf + *bufpos, num);
                /* don't treat EAGAIN, EINTR as error */
@@ -786,7 +794,7 @@
        if (n <= 0)
                return n;
        *bufpos += n;
-@@ -1641,6 +1771,7 @@ process_tos_opt(char *s, int *val)
+@@ -1665,6 +1797,7 @@ process_tos_opt(char *s, int *val)
        return 0;
  }
  
@@ -794,15 +802,15 @@
  int
  process_tls_opt(char *s, int *flags)
  {
-@@ -1754,6 +1885,7 @@ report_tls(struct tls * tls_ctx, char *
+@@ -1778,6 +1911,7 @@ report_tls(struct tls * tls_ctx, char *
  
        }
  }
 +# endif
  
  void
- report_connect(const struct sockaddr *sa, socklen_t salen, char *path)
-@@ -1796,17 +1928,12 @@ help(void)
+ report_sock(const char *msg, const struct sockaddr *sa, socklen_t salen,
+@@ -1816,17 +1950,12 @@ help(void)
        fprintf(stderr, "\tCommand Summary:\n\
        \t-4            Use IPv4\n\
        \t-6            Use IPv6\n\
@@ -820,7 +828,7 @@
        \t-k            Keep inbound sockets open for multiple connects\n\
        \t-l            Listen mode, for inbound connects\n\
        \t-M ttl                Outgoing TTL / Hop Limit\n\
-@@ -1814,14 +1941,12 @@ help(void)
+@@ -1834,14 +1963,12 @@ help(void)
        \t-N            Shutdown the network socket after EOF on stdin\n\
        \t-n            Suppress name/port resolutions\n\
        \t-O length     TCP send buffer length\n\
@@ -836,7 +844,7 @@
        \t-t            Answer TELNET negotiation\n\
        \t-U            Use UNIX domain socket\n\
        \t-u            UDP mode\n\
-@@ -1831,7 +1956,6 @@ help(void)
+@@ -1851,7 +1978,6 @@ help(void)
        \t-w timeout    Timeout for connects and final net reads\n\
        \t-X proto      Proxy protocol: \"4\", \"5\" (SOCKS) or \"connect\"\n\
        \t-x addr[:port]\tSpecify proxy address and port\n\
@@ -844,7 +852,7 @@
        \t-z            Zero-I/O mode [used for scanning]\n\
        Port numbers can be individual or ranges: lo-hi [inclusive]\n");
        exit(0);
-@@ -1841,15 +1965,11 @@ void
+@@ -1861,15 +1987,11 @@ void
  usage(int ret)
  {
        fprintf(stderr,

++++++ connect-timeout.patch ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:29.991346283 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:29.991346283 +0200
@@ -8,8 +8,8 @@
 
 --- a/netcat.c
 +++ b/netcat.c
-@@ -89,6 +89,7 @@
- 
+@@ -90,6 +90,7 @@
+ #include <ctype.h>
  #include <err.h>
  #include <errno.h>
 +#include <fcntl.h>
@@ -37,7 +37,7 @@
  int
  main(int argc, char *argv[])
  {
-@@ -1066,11 +1074,14 @@ remote_connect(const char *host, const c
+@@ -1078,11 +1086,14 @@ remote_connect(const char *host, const c
  
                set_common_sockopts(s, res->ai_family);
  
@@ -54,7 +54,7 @@
  
                save_errno = errno;
                close(s);
-@@ -1111,6 +1122,69 @@ timeout_connect(int s, const struct sock
+@@ -1123,6 +1134,69 @@ timeout_connect(int s, const struct sock
        return ret;
  }
  

++++++ dccp-support.patch ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:30.003346281 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:30.003346281 +0200
@@ -29,7 +29,7 @@
  Cannot be used together with
 --- a/netcat.c
 +++ b/netcat.c
-@@ -147,6 +147,7 @@ int        rflag;                                  /* 
Random ports flag */
+@@ -146,6 +146,7 @@ int        rflag;                                  /* 
Random ports flag */
  char   *sflag;                                        /* Source Address */
  int   tflag;                                  /* Telnet Emulation */
  int   uflag;                                  /* UDP - Default to TCP */
@@ -37,7 +37,7 @@
  int   vflag;                                  /* Verbosity */
  int   xflag;                                  /* Socks proxy */
  int   zflag;                                  /* Port Scan Flag */
-@@ -225,6 +226,7 @@ ssize_t drainbuf(int, unsigned char *, s
+@@ -224,6 +225,7 @@ ssize_t drainbuf(int, unsigned char *, s
  ssize_t fillbuf(int, unsigned char *, size_t *);
  # endif
  
@@ -45,7 +45,7 @@
  static int connect_with_timeout(int fd, const struct sockaddr *sa,
          socklen_t salen, int ctimeout);
  
-@@ -261,7 +263,7 @@ main(int argc, char *argv[])
+@@ -263,7 +265,7 @@ main(int argc, char *argv[])
  # if defined(TLS)
            "46C:cDde:FH:hI:i:K:klM:m:NnO:o:P:p:q:R:rSs:T:tUuV:vW:w:X:x:Z:z"))
  # else
@@ -54,7 +54,7 @@
  # endif
            != -1) {
                switch (ch) {
-@@ -378,6 +380,13 @@ main(int argc, char *argv[])
+@@ -380,6 +382,13 @@ main(int argc, char *argv[])
                case 'u':
                        uflag = 1;
                        break;
@@ -68,7 +68,7 @@
                case 'V':
  # if defined(RT_TABLEID_MAX)
                        rtableid = (int)strtonum(optarg, 0,
-@@ -482,6 +491,10 @@ main(int argc, char *argv[])
+@@ -484,6 +493,10 @@ main(int argc, char *argv[])
  
        /* Cruft to make sure options are clean, and used properly. */
        if (argv[0] && !argv[1] && family == AF_UNIX) {
@@ -79,7 +79,7 @@
                host = argv[0];
                uport = NULL;
        } else if (!argv[0] && lflag) {
-@@ -575,8 +588,20 @@ main(int argc, char *argv[])
+@@ -577,8 +590,20 @@ main(int argc, char *argv[])
        if (family != AF_UNIX) {
                memset(&hints, 0, sizeof(struct addrinfo));
                hints.ai_family = family;
@@ -102,7 +102,7 @@
                if (nflag)
                        hints.ai_flags |= AI_NUMERICHOST;
        }
-@@ -584,7 +609,10 @@ main(int argc, char *argv[])
+@@ -586,7 +611,10 @@ main(int argc, char *argv[])
        if (xflag) {
                if (uflag)
                        errx(1, "no proxy support for UDP mode");
@@ -114,7 +114,7 @@
                if (lflag)
                        errx(1, "no proxy support for listen");
  
-@@ -841,19 +869,20 @@ main(int argc, char *argv[])
+@@ -833,19 +861,20 @@ main(int argc, char *argv[])
                                        }
                                }
  
@@ -137,7 +137,7 @@
                                    sv ? sv->s_name : "*");
                        }
                        if (Fflag)
-@@ -1063,6 +1092,24 @@ unix_listen(char *path)
+@@ -1060,6 +1089,24 @@ unix_listen(char *path)
        return s;
  }
  
@@ -162,7 +162,7 @@
  /*
   * remote_connect()
   * Returns a socket connected to a remote host. Properly binds to a local
-@@ -1093,8 +1140,21 @@ remote_connect(const char *host, const c
+@@ -1090,8 +1137,21 @@ remote_connect(const char *host, const c
  # endif
                        memset(&ahints, 0, sizeof(struct addrinfo));
                        ahints.ai_family = res->ai_family;
@@ -186,7 +186,7 @@
                        ahints.ai_flags = AI_PASSIVE;
                        if ((error = getaddrinfo(sflag, pflag, &ahints, &ares)))
                                errx(1, "getaddrinfo: %s", gai_strerror(error));
-@@ -1106,15 +1166,16 @@ remote_connect(const char *host, const c
+@@ -1103,15 +1163,16 @@ remote_connect(const char *host, const c
                }
  
                set_common_sockopts(s, res->ai_family);
@@ -206,7 +206,7 @@
  
                save_errno = errno;
                close(s);
-@@ -1706,7 +1767,8 @@ build_ports(char *p)
+@@ -1715,7 +1776,8 @@ build_ports(char *p)
        int hi, lo, cp;
        int x = 0;
  
@@ -216,7 +216,7 @@
        if (sv) {
                if (asprintf(&portlist[0], "%d", ntohs(sv->s_port)) < 0)
                        err(1, "asprintf");
-@@ -2090,6 +2152,7 @@ help(void)
+@@ -2095,6 +2157,7 @@ help(void)
        \t-w timeout    Timeout for connects and final net reads\n\
        \t-X proto      Proxy protocol: \"4\", \"5\" (SOCKS) or \"connect\"\n\
        \t-x addr[:port]\tSpecify proxy address and port\n\
@@ -224,7 +224,7 @@
        \t-z            Zero-I/O mode [used for scanning]\n\
        Port numbers can be individual or ranges: lo-hi [inclusive]\n");
        exit(0);
-@@ -2099,7 +2162,7 @@ void
+@@ -2104,7 +2167,7 @@ void
  usage(int ret)
  {
        fprintf(stderr,

++++++ destination-port-list.patch ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:30.015346279 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:30.015346279 +0200
@@ -50,7 +50,7 @@
  is running, and which versions.
 --- a/netcat.c
 +++ b/netcat.c
-@@ -192,7 +192,7 @@ int minttl = -1;
+@@ -191,7 +191,7 @@ int minttl = -1;
  
  void  atelnet(int, unsigned char *, unsigned int);
  int   strtoport(char *portstr, int udp);
@@ -59,7 +59,7 @@
  void  help(void) __attribute__((noreturn));
  int   local_listen(const char *, const char *, struct addrinfo);
  # if defined(TLS)
-@@ -243,7 +243,7 @@ int
+@@ -242,7 +242,7 @@ int
  main(int argc, char *argv[])
  {
        int ch, s = -1, ret, socksv;
@@ -68,7 +68,7 @@
        struct addrinfo hints;
        struct servent *sv;
        socklen_t len;
-@@ -524,11 +524,11 @@ main(int argc, char *argv[])
+@@ -526,11 +526,11 @@ main(int argc, char *argv[])
        } else if (argv[0] && !argv[1]) {
                if (!lflag)
                        usage(1);
@@ -82,7 +82,7 @@
        } else
                usage(1);
  
-@@ -715,7 +715,7 @@ main(int argc, char *argv[])
+@@ -717,7 +717,7 @@ main(int argc, char *argv[])
                        else
                                s = unix_listen(host);
                } else
@@ -91,7 +91,7 @@
                if (s < 0)
                        err(1, NULL);
  
-@@ -1775,57 +1775,61 @@ strtoport(char *portstr, int udp)
+@@ -1785,57 +1785,61 @@ strtoport(char *portstr, int udp)
   * that we should try to connect to.
   */
  void
@@ -109,7 +109,7 @@
 -      if (sv) {
 -              if (asprintf(&portlist[0], "%d", ntohs(sv->s_port)) < 0)
 -                      err(1, "asprintf");
--      } else if ((n = strchr(p, '-')) != NULL) {
+-      } else if (isdigit((unsigned char)*p) && (n = strchr(p, '-')) != NULL) {
 -              *n = '\0';
 -              n++;
 -
@@ -138,7 +138,7 @@
 +                      if (asprintf(&portlist[x], "%d", ntohs(sv->s_port)) < 0)
 +                              err(1, "asprintf");
 +                      x++;
-+              } else if ((n = strchr(p[i], '-')) != NULL) {
++              } else if (isdigit((unsigned char)*p[i]) && (n = strchr(p[i], 
'-')) != NULL) {
 +                      *n = '\0';
 +                      n++;
 +

++++++ get-sev-by-name.patch ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:30.035346274 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:30.039346274 +0200
@@ -8,7 +8,7 @@
 
 --- a/netcat.c
 +++ b/netcat.c
-@@ -1653,11 +1653,16 @@ strtoport(char *portstr, int udp)
+@@ -1679,11 +1679,16 @@ strtoport(char *portstr, int udp)
  void
  build_ports(char *p)
  {
@@ -17,12 +17,12 @@
        int hi, lo, cp;
        int x = 0;
  
--      if ((n = strchr(p, '-')) != NULL) {
+-      if (isdigit((unsigned char)*p) && (n = strchr(p, '-')) != NULL) {
 +      sv = getservbyname(p, uflag ? "udp" : "tcp");
 +      if (sv) {
 +              if (asprintf(&portlist[0], "%d", ntohs(sv->s_port)) < 0)
 +                      err(1, "asprintf");
-+      } else if ((n = strchr(p, '-')) != NULL) {
++      } else if (isdigit((unsigned char)*p) && (n = strchr(p, '-')) != NULL) {
                *n = '\0';
                n++;
  

++++++ misc-failures-and-features.patch ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:30.051346272 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:30.051346272 +0200
@@ -97,7 +97,7 @@
  #include <stdarg.h>
  #include <stdio.h>
  #include <stdlib.h>
-@@ -247,7 +248,10 @@ main(int argc, char *argv[])
+@@ -246,7 +247,10 @@ main(int argc, char *argv[])
        struct addrinfo hints;
        struct servent *sv;
        socklen_t len;
@@ -109,7 +109,7 @@
        char *proxy = NULL, *proxyport = NULL;
        const char *errstr;
        struct addrinfo proxyhints;
-@@ -952,6 +956,8 @@ unix_bind(char *path, int flags)
+@@ -945,6 +949,8 @@ unix_bind(char *path, int flags)
            0)) < 0)
                return -1;
  
@@ -118,7 +118,7 @@
        memset(&s_un, 0, sizeof(struct sockaddr_un));
        s_un.sun_family = AF_UNIX;
  
-@@ -1075,8 +1081,10 @@ unix_connect(char *path)
+@@ -1070,8 +1076,10 @@ unix_connect(char *path)
                if ((s = unix_bind(unix_dg_tmp_socket, SOCK_CLOEXEC)) < 0)
                        return -1;
        } else {
@@ -130,7 +130,7 @@
        }
  
        memset(&s_un, 0, sizeof(struct sockaddr_un));
-@@ -1086,10 +1094,12 @@ unix_connect(char *path)
+@@ -1081,10 +1089,12 @@ unix_connect(char *path)
            sizeof(s_un.sun_path)) {
                close(s);
                errno = ENAMETOOLONG;

++++++ netcat-openbsd_1.195.orig.tar.gz -> netcat-openbsd_1.203.orig.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/netcat-openbsd-1.195/nc.1 
new/netcat-openbsd-1.203/nc.1
--- old/netcat-openbsd-1.195/nc.1       2018-10-21 12:34:47.000000000 +0200
+++ new/netcat-openbsd-1.203/nc.1       2019-08-04 18:42:03.000000000 +0200
@@ -1,4 +1,4 @@
-.\"     $OpenBSD: nc.1,v 1.91 2018/09/25 20:05:07 jmc Exp $
+.\"     $OpenBSD: nc.1,v 1.93 2018/12/27 17:45:36 jmc Exp $
 .\"
 .\" Copyright (c) 1996 David Sacerdote
 .\" All rights reserved.
@@ -25,7 +25,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd $Mdocdate: September 25 2018 $
+.Dd $Mdocdate: December 27 2018 $
 .Dt NC 1
 .Os
 .Sh NAME
@@ -391,8 +391,8 @@
 option is given).
 .Pp
 .Ar port
-can be a specified as a numeric port number, or as a service name.
-Ports may be specified in a range of the form
+can be specified as a numeric port number or as a service name.
+Port ranges may be specified as numeric port numbers of the form
 .Ar nn Ns - Ns Ar mm .
 In general,
 a destination port must be specified,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/netcat-openbsd-1.195/netcat.c 
new/netcat-openbsd-1.203/netcat.c
--- old/netcat-openbsd-1.195/netcat.c   2018-10-21 12:34:47.000000000 +0200
+++ new/netcat-openbsd-1.203/netcat.c   2019-08-04 18:42:03.000000000 +0200
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.195 2018/10/04 17:04:50 bluhm Exp $ */
+/* $OpenBSD: netcat.c,v 1.203 2019/02/26 17:32:47 jsing Exp $ */
 /*
  * Copyright (c) 2001 Eric Jackson <[email protected]>
  * Copyright (c) 2015 Bob Beck.  All rights reserved.
@@ -42,6 +42,7 @@
 #include <netinet/ip.h>
 #include <arpa/telnet.h>
 
+#include <ctype.h>
 #include <err.h>
 #include <errno.h>
 #include <limits.h>
@@ -66,7 +67,6 @@
 #define POLL_NETIN     2
 #define POLL_STDOUT    3
 #define BUFSIZE                16384
-#define DEFAULT_CA_FILE        "/etc/ssl/cert.pem"
 
 #define TLS_NOVERIFY   (1 << 1)
 #define TLS_NONAME     (1 << 2)
@@ -98,10 +98,10 @@
 int    rtableid = -1;
 
 int    usetls;                                 /* use TLS */
-char    *Cflag;                                        /* Public cert file */
-char    *Kflag;                                        /* Private key file */
-char    *oflag;                                        /* OCSP stapling file */
-char    *Rflag = DEFAULT_CA_FILE;              /* Root CA file */
+const char    *Cflag;                          /* Public cert file */
+const char    *Kflag;                          /* Private key file */
+const char    *oflag;                          /* OCSP stapling file */
+const char    *Rflag;                          /* Root CA file */
 int    tls_cachanged;                          /* Using non-default CA file */
 int     TLSopt;                                        /* TLS options */
 char   *tls_expectname;                        /* required name in peer cert */
@@ -138,7 +138,7 @@
 int    process_tos_opt(char *, int *);
 int    process_tls_opt(char *, int *);
 void   save_peer_cert(struct tls *_tls_ctx, FILE *_fp);
-void   report_connect(const struct sockaddr *, socklen_t, char *);
+void   report_sock(const char *, const struct sockaddr *, socklen_t, char *);
 void   report_tls(struct tls *tls_ctx, char * host);
 void   usage(int);
 ssize_t drainbuf(int, unsigned char *, size_t *, struct tls *);
@@ -168,6 +168,7 @@
        host = NULL;
        uport = NULL;
        sv = NULL;
+       Rflag = tls_default_ca_cert_file();
 
        signal(SIGPIPE, SIG_IGN);
 
@@ -597,7 +598,8 @@
                                        err(1, "connect");
 
                                if (vflag)
-                                       report_connect((struct sockaddr *)&z, 
len, NULL);
+                                       report_sock("Connection received",
+                                           (struct sockaddr *)&z, len, NULL);
 
                                readwrite(s, NULL);
                        } else {
@@ -612,7 +614,8 @@
                                        err(1, "accept");
                                }
                                if (vflag)
-                                       report_connect((struct sockaddr 
*)&cliaddr, len,
+                                       report_sock("Connection received",
+                                           (struct sockaddr *)&cliaddr, len,
                                            family == AF_UNIX ? host : NULL);
                                if ((usetls) &&
                                    (tls_cctx = tls_setup_server(tls_ctx, 
connfd, host)))
@@ -639,8 +642,10 @@
                        if (!zflag)
                                readwrite(s, NULL);
                        close(s);
-               } else
+               } else {
+                       warn("%s", host);
                        ret = 1;
+               }
 
                if (uflag)
                        unlink(unix_dg_tmp_socket);
@@ -753,6 +758,8 @@
                errno = save_errno;
                return -1;
        }
+       if (vflag)
+               report_sock("Bound", NULL, 0, path);
 
        return s;
 }
@@ -889,13 +896,16 @@
 unix_listen(char *path)
 {
        int s;
+
        if ((s = unix_bind(path, 0)) < 0)
                return -1;
-
        if (listen(s, 5) < 0) {
                close(s);
                return -1;
        }
+       if (vflag)
+               report_sock("Listening", NULL, 0, path);
+
        return s;
 }
 
@@ -1036,6 +1046,16 @@
                if (listen(s, 1) < 0)
                        err(1, "listen");
        }
+       if (vflag && s != -1) {
+               struct sockaddr_storage ss;
+               socklen_t len;
+
+               len = sizeof(ss);
+               if (getsockname(s, (struct sockaddr *)&ss, &len) == -1)
+                       err(1, "getsockname");
+               report_sock(uflag ? "Bound" : "Listening",
+                   (struct sockaddr *)&ss, len, NULL);
+       }
 
        freeaddrinfo(res0);
 
@@ -1247,9 +1267,11 @@
        ssize_t n;
        ssize_t adjust;
 
-       if (tls)
+       if (tls) {
                n = tls_write(tls, buf, *bufpos);
-       else {
+               if (n == -1)
+                       errx(1, "tls write failed (%s)", tls_error(tls));
+       } else {
                n = write(fd, buf, *bufpos);
                /* don't treat EAGAIN, EINTR as error */
                if (n == -1 && (errno == EAGAIN || errno == EINTR))
@@ -1271,9 +1293,11 @@
        size_t num = BUFSIZE - *bufpos;
        ssize_t n;
 
-       if (tls)
+       if (tls) {
                n = tls_read(tls, buf + *bufpos, num);
-       else {
+               if (n == -1)
+                       errx(1, "tls read failed (%s)", tls_error(tls));
+       } else {
                n = read(fd, buf + *bufpos, num);
                /* don't treat EAGAIN, EINTR as error */
                if (n == -1 && (errno == EAGAIN || errno == EINTR))
@@ -1307,9 +1331,9 @@
        if (isatty(STDOUT_FILENO))
                errx(1, "Cannot pass file descriptor to tty");
 
-       bzero(&mh, sizeof(mh));
-       bzero(&cmsgbuf, sizeof(cmsgbuf));
-       bzero(&iov, sizeof(iov));
+       memset(&mh, 0, sizeof(mh));
+       memset(&cmsgbuf, 0, sizeof(cmsgbuf));
+       memset(&iov, 0, sizeof(iov));
 
        mh.msg_control = (caddr_t)&cmsgbuf.buf;
        mh.msg_controllen = sizeof(cmsgbuf.buf);
@@ -1324,7 +1348,7 @@
        mh.msg_iov = &iov;
        mh.msg_iovlen = 1;
 
-       bzero(&pfd, sizeof(pfd));
+       memset(&pfd, 0, sizeof(pfd));
        pfd.fd = STDOUT_FILENO;
        pfd.events = POLLOUT;
        for (;;) {
@@ -1408,7 +1432,7 @@
        int hi, lo, cp;
        int x = 0;
 
-       if ((n = strchr(p, '-')) != NULL) {
+       if (isdigit((unsigned char)*p) && (n = strchr(p, '-')) != NULL) {
                *n = '\0';
                n++;
 
@@ -1688,34 +1712,30 @@
 }
 
 void
-report_connect(const struct sockaddr *sa, socklen_t salen, char *path)
+report_sock(const char *msg, const struct sockaddr *sa, socklen_t salen,
+    char *path)
 {
-       char remote_host[NI_MAXHOST];
-       char remote_port[NI_MAXSERV];
+       char host[NI_MAXHOST], port[NI_MAXSERV];
        int herr;
        int flags = NI_NUMERICSERV;
 
        if (path != NULL) {
-               fprintf(stderr, "Connection on %s received!\n", path);
+               fprintf(stderr, "%s on %s\n", msg, path);
                return;
        }
 
        if (nflag)
                flags |= NI_NUMERICHOST;
 
-       if ((herr = getnameinfo(sa, salen,
-           remote_host, sizeof(remote_host),
-           remote_port, sizeof(remote_port),
-           flags)) != 0) {
+       if ((herr = getnameinfo(sa, salen, host, sizeof(host),
+           port, sizeof(port), flags)) != 0) {
                if (herr == EAI_SYSTEM)
                        err(1, "getnameinfo");
                else
                        errx(1, "getnameinfo: %s", gai_strerror(herr));
        }
 
-       fprintf(stderr,
-           "Connection from %s %s "
-           "received!\n", remote_host, remote_port);
+       fprintf(stderr, "%s on %s %s\n", msg, host, port);
 }
 
 void
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/netcat-openbsd-1.195/socks.c 
new/netcat-openbsd-1.203/socks.c
--- old/netcat-openbsd-1.195/socks.c    2018-10-21 12:34:47.000000000 +0200
+++ new/netcat-openbsd-1.203/socks.c    2019-08-04 18:42:03.000000000 +0200
@@ -1,4 +1,4 @@
-/*     $OpenBSD: socks.c,v 1.25 2018/03/27 16:31:10 deraadt Exp $      */
+/*     $OpenBSD: socks.c,v 1.27 2019/01/10 12:44:54 mestre Exp $       */
 
 /*
  * Copyright (c) 1999 Niklas Hallqvist.  All rights reserved.
@@ -65,7 +65,7 @@
        int r;
        struct addrinfo hints, *res;
 
-       bzero(&hints, sizeof(hints));
+       memset(&hints, 0, sizeof(hints));
        hints.ai_family = v4only ? PF_INET : PF_UNSPEC;
        hints.ai_flags = numeric ? AI_NUMERICHOST : 0;
        hints.ai_socktype = SOCK_STREAM;

++++++ port-to-linux-with-libsd.patch ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:30.211346239 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:30.215346238 +0200
@@ -108,9 +108,9 @@
 +#endif /* IPTOS_DSCP_EF */
 +
  
+ #include <ctype.h>
  #include <err.h>
- #include <errno.h>
-@@ -55,6 +100,8 @@
+@@ -56,6 +101,8 @@
  #include <time.h>
  #include <tls.h>
  #include <unistd.h>
@@ -119,7 +119,7 @@
  
  #include "atomicio.h"
  
-@@ -268,10 +315,14 @@ main(int argc, char *argv[])
+@@ -269,10 +316,14 @@ main(int argc, char *argv[])
                        uflag = 1;
                        break;
                case 'V':
@@ -134,7 +134,7 @@
                        break;
                case 'v':
                        vflag = 1;
-@@ -320,7 +371,11 @@ main(int argc, char *argv[])
+@@ -321,7 +372,11 @@ main(int argc, char *argv[])
                        oflag = optarg;
                        break;
                case 'S':
@@ -146,7 +146,7 @@
                        break;
                case 'T':
                        errstr = NULL;
-@@ -345,14 +400,23 @@ main(int argc, char *argv[])
+@@ -346,14 +401,23 @@ main(int argc, char *argv[])
        argc -= optind;
        argv += optind;
  
@@ -170,7 +170,7 @@
        } else if (argv[0] && !argv[1]) {
                if (!lflag)
                        usage(1);
-@@ -387,33 +451,6 @@ main(int argc, char *argv[])
+@@ -388,33 +452,6 @@ main(int argc, char *argv[])
                }
        }
  
@@ -204,7 +204,7 @@
        if (!lflag && kflag)
                errx(1, "must use -l with -k");
        if (uflag && usetls)
-@@ -448,8 +485,8 @@ main(int argc, char *argv[])
+@@ -449,8 +486,8 @@ main(int argc, char *argv[])
                } else {
                        strlcpy(unix_dg_tmp_socket_buf, "/tmp/nc.XXXXXXXXXX",
                            UNIX_DG_TMP_SOCKET_SIZE);
@@ -215,7 +215,7 @@
                        unix_dg_tmp_socket = unix_dg_tmp_socket_buf;
                }
        }
-@@ -923,8 +960,10 @@ remote_connect(const char *host, const c
+@@ -933,8 +970,10 @@ remote_connect(const char *host, const c
                if (sflag || pflag) {
                        struct addrinfo ahints, *ares;
  
@@ -226,7 +226,7 @@
                        memset(&ahints, 0, sizeof(struct addrinfo));
                        ahints.ai_family = res->ai_family;
                        ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM;
-@@ -1016,9 +1055,15 @@ local_listen(const char *host, const cha
+@@ -1026,9 +1065,15 @@ local_listen(const char *host, const cha
                    res->ai_protocol)) < 0)
                        continue;
  
@@ -242,7 +242,7 @@
  
                set_common_sockopts(s, res->ai_family);
  
-@@ -1474,11 +1519,13 @@ set_common_sockopts(int s, int af)
+@@ -1498,11 +1543,13 @@ set_common_sockopts(int s, int af)
  {
        int x = 1;
  
@@ -256,7 +256,7 @@
        if (Dflag) {
                if (setsockopt(s, SOL_SOCKET, SO_DEBUG,
                        &x, sizeof(x)) == -1)
-@@ -1489,9 +1536,14 @@ set_common_sockopts(int s, int af)
+@@ -1513,9 +1560,14 @@ set_common_sockopts(int s, int af)
                    IP_TOS, &Tflag, sizeof(Tflag)) == -1)
                        err(1, "set IP ToS");
  
@@ -271,7 +271,7 @@
        }
        if (Iflag) {
                if (setsockopt(s, SOL_SOCKET, SO_RCVBUF,
-@@ -1509,19 +1561,34 @@ set_common_sockopts(int s, int af)
+@@ -1533,19 +1585,34 @@ set_common_sockopts(int s, int af)
                    IP_TTL, &ttl, sizeof(ttl)))
                        err(1, "set IP TTL");
  
@@ -306,7 +306,7 @@
        }
  }
  
-@@ -1556,6 +1623,7 @@ process_tos_opt(char *s, int *val)
+@@ -1580,6 +1647,7 @@ process_tos_opt(char *s, int *val)
                { "cs7",                IPTOS_DSCP_CS7 },
                { "ef",                 IPTOS_DSCP_EF },
                { "inetcontrol",        IPTOS_PREC_INTERNETCONTROL },
@@ -314,7 +314,7 @@
                { "lowdelay",           IPTOS_LOWDELAY },
                { "netcontrol",         IPTOS_PREC_NETCONTROL },
                { "reliability",        IPTOS_RELIABILITY },
-@@ -1721,6 +1789,9 @@ report_connect(const struct sockaddr *sa
+@@ -1741,6 +1809,9 @@ report_sock(const char *msg, const struc
  void
  help(void)
  {
@@ -324,7 +324,7 @@
        usage(0);
        fprintf(stderr, "\tCommand Summary:\n\
        \t-4            Use IPv4\n\
-@@ -1763,7 +1834,7 @@ help(void)
+@@ -1783,7 +1854,7 @@ help(void)
        \t-Z            Peer certificate file\n\
        \t-z            Zero-I/O mode [used for scanning]\n\
        Port numbers can be individual or ranges: lo-hi [inclusive]\n");

++++++ quit-timer.patch ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:30.227346236 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:30.227346236 +0200
@@ -52,7 +52,7 @@
  int
  main(int argc, char *argv[])
  {
-@@ -253,9 +256,9 @@ main(int argc, char *argv[])
+@@ -256,9 +259,9 @@ main(int argc, char *argv[])
  
        while ((ch = getopt(argc, argv,
  # if defined(TLS)
@@ -64,7 +64,7 @@
  # endif
            != -1) {
                switch (ch) {
-@@ -347,6 +350,13 @@ main(int argc, char *argv[])
+@@ -350,6 +353,13 @@ main(int argc, char *argv[])
                case 'p':
                        pflag = optarg;
                        break;
@@ -78,7 +78,7 @@
  # if defined(TLS)
                case 'R':
                        tls_cachanged = 1;
-@@ -1297,15 +1307,27 @@ readwrite(int net_fd)
+@@ -1319,15 +1329,27 @@ readwrite(int net_fd)
        while (1) {
                /* both inputs are gone, buffers are empty, we are done */
                if (pfd[POLL_STDIN].fd == -1 && pfd[POLL_NETIN].fd == -1 &&
@@ -112,7 +112,7 @@
  
                /* poll */
                num_fds = poll(pfd, 4, timeout);
-@@ -2032,6 +2054,7 @@ help(void)
+@@ -2052,6 +2074,7 @@ help(void)
        \t-O length     TCP send buffer length\n\
        \t-P proxyuser\tUsername for proxy authentication\n\
        \t-p port\t     Specify local port for remote connects\n\
@@ -120,7 +120,7 @@
        \t-r            Randomize remote ports\n\
        \t-S            Enable the TCP MD5 signature option\n\
        \t-s source     Local source address\n\
-@@ -2056,10 +2079,19 @@ usage(int ret)
+@@ -2076,10 +2099,19 @@ usage(int ret)
        fprintf(stderr,
            "usage: nc [-46CDdFhklNnrStUuvz] [-I length] [-i interval] [-M 
ttl]\n"
            "\t  [-m minttl] [-O length] [-P proxy_username] [-p source_port]\n"

++++++ send-crlf.patch ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:30.243346233 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:30.243346233 +0200
@@ -3,9 +3,9 @@
 Subject: send crlf
 
 ---
- nc.1     |    9 ++++++-
- netcat.c |   72 
+++++++++++++++++++++++++++++++++++----------------------------
- 2 files changed, 48 insertions(+), 33 deletions(-)
+ nc.1     |    9 +++++--
+ netcat.c |   74 
++++++++++++++++++++++++++++++++++-----------------------------
+ 2 files changed, 48 insertions(+), 35 deletions(-)
 
 --- a/nc.1
 +++ b/nc.1
@@ -59,7 +59,7 @@
  ssize_t fillbuf(int, unsigned char *, size_t *);
  # endif
  
-@@ -253,7 +255,7 @@ main(int argc, char *argv[])
+@@ -256,7 +258,7 @@ main(int argc, char *argv[])
  # if defined(TLS)
            "46C:cDde:FH:hI:i:K:klM:m:NnO:o:P:p:R:rSs:T:tUuV:vW:w:X:x:Z:z"))
  # else
@@ -68,7 +68,7 @@
  # endif
            != -1) {
                switch (ch) {
-@@ -283,6 +285,10 @@ main(int argc, char *argv[])
+@@ -286,6 +288,10 @@ main(int argc, char *argv[])
                case 'c':
                        usetls = 1;
                        break;
@@ -79,7 +79,7 @@
  # endif
                case 'd':
                        dflag = 1;
-@@ -1301,12 +1307,6 @@ readwrite(int net_fd)
+@@ -1323,12 +1329,6 @@ readwrite(int net_fd)
                    stdinbufpos == 0 && netinbufpos == 0)
                        return;
  
@@ -92,7 +92,7 @@
                /* poll */
                num_fds = poll(pfd, 4, timeout);
  
-@@ -1386,7 +1386,7 @@ readwrite(int net_fd)
+@@ -1408,7 +1408,7 @@ readwrite(int net_fd)
                                pfd[POLL_NETOUT].events = POLLOUT;
                        else
  # else
@@ -101,7 +101,7 @@
  # endif
                        if (ret == -1)
                                pfd[POLL_NETOUT].fd = -1;
-@@ -1445,7 +1445,7 @@ readwrite(int net_fd)
+@@ -1467,7 +1467,7 @@ readwrite(int net_fd)
                                pfd[POLL_STDOUT].events = POLLOUT;
                        else
  # else
@@ -110,7 +110,7 @@
  # endif
                        if (ret == -1)
                                pfd[POLL_STDOUT].fd = -1;
-@@ -1471,31 +1471,40 @@ readwrite(int net_fd)
+@@ -1493,33 +1493,40 @@ readwrite(int net_fd)
  }
  
  ssize_t
@@ -127,9 +127,11 @@
 +      unsigned char *lf = NULL;
  
 -# if defined(TLS)
--      if (tls)
+-      if (tls) {
 -              n = tls_write(tls, buf, *bufpos);
--      else {
+-              if (n == -1)
+-                      errx(1, "tls write failed (%s)", tls_error(tls));
+-      } else {
 -# endif
 -              n = write(fd, buf, *bufpos);
 -              /* don't treat EAGAIN, EINTR as error */
@@ -171,7 +173,7 @@
        /* adjust buffer */
        adjust = *bufpos - n;
        if (adjust > 0)
-@@ -2007,6 +2016,7 @@ help(void)
+@@ -2029,6 +2036,7 @@ help(void)
        fprintf(stderr, "\tCommand Summary:\n\
        \t-4            Use IPv4\n\
        \t-6            Use IPv6\n\
@@ -179,7 +181,7 @@
        \t-D            Enable the debug socket option\n\
        \t-d            Detach from stdin\n\
        \t-F            Pass socket fd\n\
-@@ -2044,7 +2054,7 @@ void
+@@ -2066,7 +2074,7 @@ void
  usage(int ret)
  {
        fprintf(stderr,

++++++ serialized-handling-multiple-clients.patch ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:30.255346230 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:30.255346230 +0200
@@ -3,36 +3,24 @@
 Subject: serialized handling multiple clients
 
 ---
- netcat.c |   44 +++++++++++++++++++++-----------------------
- 1 file changed, 21 insertions(+), 23 deletions(-)
+ netcat.c |   17 ++++++++---------
+ 1 file changed, 8 insertions(+), 9 deletions(-)
 
 --- a/netcat.c
 +++ b/netcat.c
-@@ -705,6 +705,23 @@ main(int argc, char *argv[])
+@@ -707,7 +707,10 @@ main(int argc, char *argv[])
                                s = unix_bind(host, 0);
                        else
                                s = unix_listen(host);
+-              }
 +              } else
 +                      s = local_listen(host, uport, hints);
 +              if (s < 0)
 +                      err(1, NULL);
-+
-+              if (vflag && (family != AF_UNIX)) {
-+                      char* local;
-+                      if (family == AF_INET)
-+                              local = "0.0.0.0";
-+                      else if (family == AF_INET6)
-+                              local = "::";
-+                      else
-+                              local = "unknown";
-+                      fprintf(stderr, "Listening on [%s] (family %d, port 
%d)\n",
-+                              host ?: local,
-+                              family,
-+                              *uport);
-               }
  
  # if defined(TLS)
-@@ -719,28 +736,6 @@ main(int argc, char *argv[])
+               if (usetls) {
+@@ -721,13 +724,6 @@ main(int argc, char *argv[])
  # endif
                /* Allow only one connection at a time, but stay alive. */
                for (;;) {
@@ -43,25 +31,10 @@
 -                      }
 -                      if (s < 0)
 -                              err(1, NULL);
--
--                      if (vflag && (family != AF_UNIX)) {
--                              char* local;
--                              if (family == AF_INET)
--                                      local = "0.0.0.0";
--                              else if (family == AF_INET6)
--                                      local = "::";
--                              else
--                                      local = "unknown";
--                              fprintf(stderr, "Listening on [%s] (family %d, 
port %d)\n",
--                                      host ?: local,
--                                      family,
--                                      *uport);
--                      }
--
                        if (uflag && kflag) {
                                /*
                                 * For UDP and -k, don't connect the socket,
-@@ -814,8 +809,11 @@ main(int argc, char *argv[])
+@@ -804,8 +800,11 @@ main(int argc, char *argv[])
                                        err(1, "connect");
                        }
  

++++++ set-TCP-MD5SIG-correctly-for-client-connections.patch ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:30.267346228 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:30.267346228 +0200
@@ -8,7 +8,7 @@
 
 --- a/netcat.c
 +++ b/netcat.c
-@@ -47,6 +47,9 @@
+@@ -46,6 +46,9 @@
  #ifdef __linux__
  # include <linux/in6.h>
  #endif
@@ -18,7 +18,7 @@
  
  #ifndef IPTOS_LOWDELAY
  # define IPTOS_LOWDELAY 0x10
-@@ -176,6 +179,9 @@ FILE       *Zflag;                                 /* file 
to save peer ce
+@@ -175,6 +178,9 @@ FILE       *Zflag;                                 /* file 
to save peer ce
  int   Cflag = 0;                      /* CRLF line-ending */
  # endif
  
@@ -28,7 +28,7 @@
  int recvcount, recvlimit;
  int timeout = -1;
  int family = AF_UNSPEC;
-@@ -206,7 +212,7 @@ int        udptest(int);
+@@ -205,7 +211,7 @@ int        udptest(int);
  int   unix_bind(char *, int);
  int   unix_connect(char *);
  int   unix_listen(char *);
@@ -37,7 +37,7 @@
  int   process_tos_opt(char *, int *);
  # if defined(TLS)
  int   process_tls_opt(char *, int *);
-@@ -456,7 +462,10 @@ main(int argc, char *argv[])
+@@ -458,7 +464,10 @@ main(int argc, char *argv[])
                        break;
  # endif
                case 'S':
@@ -49,7 +49,7 @@
                        Sflag = 1;
  # else
                        errx(1, "no TCP MD5 signature support available");
-@@ -1171,7 +1180,7 @@ remote_connect(const char *host, const c
+@@ -1169,7 +1178,7 @@ remote_connect(const char *host, const c
                        freeaddrinfo(ares);
                }
  
@@ -58,7 +58,7 @@
                char *proto = proto_name(uflag, dccpflag);
  
                if ((error = connect_with_timeout(s, res->ai_addr, 
res->ai_addrlen, timeout)) == CONNECTION_SUCCESS)
-@@ -1325,7 +1334,7 @@ local_listen(const char *host, const cha
+@@ -1323,7 +1332,7 @@ local_listen(const char *host, const cha
                        err(1, NULL);
  # endif
  
@@ -67,7 +67,7 @@
  
                if (bind(s, (struct sockaddr *)res->ai_addr,
                    res->ai_addrlen) == 0)
-@@ -1845,9 +1854,10 @@ udptest(int s)
+@@ -1855,9 +1864,10 @@ udptest(int s)
  }
  
  void
@@ -79,7 +79,7 @@
  
  # if defined(SO_BROADCAST)
        if (bflag) {
-@@ -1858,10 +1868,17 @@ set_common_sockopts(int s, int af)
+@@ -1868,10 +1878,17 @@ set_common_sockopts(int s, int af)
                        err(1, NULL);
        }
  # endif

++++++ udp-scan-timeout.patch ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:30.283346225 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:30.283346225 +0200
@@ -17,7 +17,7 @@
  /* Command Line Options */
  int   dflag;                                  /* detached, no stdin */
  int   Fflag;                                  /* fdpass sock to stdout */
-@@ -815,7 +817,7 @@ main(int argc, char *argv[])
+@@ -822,7 +824,7 @@ main(int argc, char *argv[])
                                continue;
  
                        ret = 0;
@@ -26,7 +26,7 @@
                                /* For UDP, make sure we are connected. */
                                if (uflag) {
                                        if (udptest(s) == -1) {
-@@ -1743,15 +1745,20 @@ build_ports(char *p)
+@@ -1767,15 +1769,20 @@ build_ports(char *p)
  int
  udptest(int s)
  {

++++++ use-flags-to-specify-listen-address.patch ++++++
--- /var/tmp/diff_new_pack.Rs1YGk/_old  2019-09-19 15:46:30.299346221 +0200
+++ /var/tmp/diff_new_pack.Rs1YGk/_new  2019-09-19 15:46:30.299346221 +0200
@@ -43,7 +43,7 @@
  Change the IPv4 TOS/IPv6 traffic class value.
 --- a/netcat.c
 +++ b/netcat.c
-@@ -507,31 +507,40 @@ main(int argc, char *argv[])
+@@ -509,31 +509,40 @@ main(int argc, char *argv[])
  # endif
  
        /* Cruft to make sure options are clean, and used properly. */
@@ -97,7 +97,7 @@
 +                      errx(1, "missing socket pathname");
 +      } else if (!uport || !*uport)
 +              errx(1, "missing port number");
-+ 
++
 +      if (lflag && zflag)
 +              errx(1, "cannot use -z and -l");
 +


Reply via email to