From fe3895044501b4a3027ec18601cf2678cde65c2d Mon Sep 17 00:00:00 2001 From: Martin Osvald Date: Fri, 25 Nov 2022 16:35:53 +0100 Subject: [PATCH] ncat does not work with --proxy Resolves: #2140101 --- ncat-proxy.patch | 31 +++++++++++++++++++++++++++++++ nmap.spec | 8 +++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 ncat-proxy.patch diff --git a/ncat-proxy.patch b/ncat-proxy.patch new file mode 100644 index 0000000..30c703b --- /dev/null +++ b/ncat-proxy.patch @@ -0,0 +1,31 @@ +commit 169d7e5a922ef8e63b51ee2bdf4fd4ad60ed2689 +Author: dmiller +Date: Thu Nov 19 17:34:24 2020 +0000 + + Restore call to post_connect in non-ssl case. Fixes #2149 + +diff --git a/ncat/ncat_connect.c b/ncat/ncat_connect.c +index 606eac412..f59dd4372 100644 +--- a/ncat/ncat_connect.c ++++ b/ncat/ncat_connect.c +@@ -1064,12 +1064,17 @@ int ncat_connect(void) + bye("Failed to set hostname on iod."); + if (o.ssl) + { ++ /* connect_handler creates stdin_nsi and calls post_connect */ + nsock_reconnect_ssl(mypool, cs.sock_nsi, connect_handler, o.conntimeout, NULL, NULL); + } ++ else ++ { ++ /* Create IOD for nsp->stdin */ ++ if ((cs.stdin_nsi = nsock_iod_new2(mypool, 0, NULL)) == NULL) ++ bye("Failed to create stdin nsiod."); + +- /* Create IOD for nsp->stdin */ +- if ((cs.stdin_nsi = nsock_iod_new2(mypool, 0, NULL)) == NULL) +- bye("Failed to create stdin nsiod."); ++ post_connect(mypool, cs.sock_nsi); ++ } + } + + /* connect */ diff --git a/nmap.spec b/nmap.spec index 5f1a04a..3d7b01a 100644 --- a/nmap.spec +++ b/nmap.spec @@ -7,7 +7,7 @@ Name: nmap Epoch: 3 Version: 7.91 #global prerelease TEST5 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Network exploration tool and security scanner URL: http://nmap.org/ # Uses combination of licenses based on GPL license, but with extra modification @@ -36,6 +36,9 @@ Patch9: nmap-safe_fd_functions.patch ## https://github.com/nmap/nmap/commit/f6b40614e4a8131394792d590965f8af3c635323.patch Patch10: nmap-unix_crash.patch +# https://github.com/nmap/nmap/commit/169d7e5a922ef8e63b51ee2bdf4fd4ad60ed2689.patch +Patch11: ncat-proxy.patch + BuildRequires: automake make BuildRequires: autoconf BuildRequires: gcc-c++ @@ -157,6 +160,9 @@ fi %{_mandir}/man1/ncat.1.gz %changelog +* Fri Nov 25 2022 Martin Osvald - 3:7.91-11 +- ncat does not work with --proxy (#2140101) + * Mon Aug 09 2021 Mohan Boddu - 3:7.91-10 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags Related: rhbz#1991688