package/nmap: fix ncat on Unix socket
authorAlexey Neyman <stilor@att.net>
Wed, 28 Jul 2021 02:15:34 +0000 (19:15 -0700)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 28 Jul 2021 19:39:28 +0000 (21:39 +0200)
Starting with nmap 7.91, ncat segfaults on an attempt to use it for a
Unix-domain socket (`ncat -U path`). The fix has been committed to nmap
in r38121.

Signed-off-by: Alexey Neyman <stilor@att.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/nmap/0002-ncat-unix-socket.patch [new file with mode: 0644]

diff --git a/package/nmap/0002-ncat-unix-socket.patch b/package/nmap/0002-ncat-unix-socket.patch
new file mode 100644 (file)
index 0000000..b6484eb
--- /dev/null
@@ -0,0 +1,30 @@
+ChangeLog:
+
+o [Ncat][GH#2154] Ncat no longer crashes when used with Unix domain sockets.
+
+Backported from: r38121
+
+Signed-off-by: Alexey Neyman <stilor@att.net>
+
+Index: ncat/ncat_main.c
+===================================================================
+--- a/ncat/ncat_main.c (revision 38120)
++++ b/ncat/ncat_main.c (revision 38121)
+@@ -846,7 +846,7 @@
+             targetaddrs->addr.un.sun_family = AF_UNIX;
+             strncpy(targetaddrs->addr.un.sun_path, argv[optind], sizeof(targetaddrs->addr.un.sun_path));
+             targetaddrs->addrlen = SUN_LEN(&targetaddrs->addr.un);
+-            o.target = argv[optind];
++            o.sslservername = o.target = argv[optind];
+             optind++;
+         } else
+ #endif
+@@ -865,7 +865,7 @@
+                 targetaddrs->addr.vm.svm_cid = long_cid;
+                 targetaddrs->addrlen = sizeof(targetaddrs->addr.vm);
+-                o.target = argv[optind];
++                o.sslservername = o.target = argv[optind];
+                 optind++;
+             }
+         } else