ncat does not work with --proxy

Resolves: #2140101
This commit is contained in:
Martin Osvald 2022-11-25 16:35:53 +01:00
parent 3da5e08fc3
commit fe38950445
2 changed files with 38 additions and 1 deletions

31
ncat-proxy.patch Normal file
View File

@ -0,0 +1,31 @@
commit 169d7e5a922ef8e63b51ee2bdf4fd4ad60ed2689
Author: dmiller <dmiller@e0a8ed71-7df4-0310-8962-fdc924857419>
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 */

View File

@ -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 <mosvald@redhat.com> - 3:7.91-11
- ncat does not work with --proxy (#2140101)
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 3:7.91-10
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688