From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5FD9B1382C5 for ; Thu, 11 Mar 2021 18:14:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 63BBEE08DD; Thu, 11 Mar 2021 18:14:44 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 36C26E08DD for ; Thu, 11 Mar 2021 18:14:44 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BA26C340D06 for ; Thu, 11 Mar 2021 18:14:42 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 22D3358F for ; Thu, 11 Mar 2021 18:14:41 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1615486442.b2d8627328c93bdd62a507f7e78228a8e00de59e.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/nmap/, net-analyzer/nmap/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-analyzer/nmap/files/nmap-7.91-ncat-proxy.patch net-analyzer/nmap/files/nmap-7.91-ncat-unix-sockets.patch net-analyzer/nmap/nmap-7.91-r2.ebuild X-VCS-Directories: net-analyzer/nmap/ net-analyzer/nmap/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: b2d8627328c93bdd62a507f7e78228a8e00de59e X-VCS-Branch: master Date: Thu, 11 Mar 2021 18:14:41 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b97f1d8a-f191-47f7-bd9f-4b14f2bea038 X-Archives-Hash: df8ce061e94b676f8fe3cd6474015c39 commit: b2d8627328c93bdd62a507f7e78228a8e00de59e Author: Sam James gentoo org> AuthorDate: Thu Mar 11 18:14:02 2021 +0000 Commit: Sam James gentoo org> CommitDate: Thu Mar 11 18:14:02 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2d86273 net-analyzer/nmap: add upstream patches for ncat Closes: https://bugs.gentoo.org/765148 Closes: https://bugs.gentoo.org/770808 Signed-off-by: Sam James gentoo.org> net-analyzer/nmap/files/nmap-7.91-ncat-proxy.patch | 37 +++++++ .../nmap/files/nmap-7.91-ncat-unix-sockets.patch | 30 ++++++ net-analyzer/nmap/nmap-7.91-r2.ebuild | 118 +++++++++++++++++++++ 3 files changed, 185 insertions(+) diff --git a/net-analyzer/nmap/files/nmap-7.91-ncat-proxy.patch b/net-analyzer/nmap/files/nmap-7.91-ncat-proxy.patch new file mode 100644 index 00000000000..513c7fbd418 --- /dev/null +++ b/net-analyzer/nmap/files/nmap-7.91-ncat-proxy.patch @@ -0,0 +1,37 @@ +https://bugs.gentoo.org/770808 +https://github.com/nmap/nmap/commit/169d7e5a922ef8e63b51ee2bdf4fd4ad60ed2689 + +From 169d7e5a922ef8e63b51ee2bdf4fd4ad60ed2689 Mon Sep 17 00:00:00 2001 +From: dmiller +Date: Thu, 19 Nov 2020 17:34:24 +0000 +Subject: [PATCH] Restore call to post_connect in non-ssl case. Fixes #2149 + +--- + ncat/ncat_connect.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/ncat/ncat_connect.c b/ncat/ncat_connect.c +index 606eac412f..f59dd4372f 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/net-analyzer/nmap/files/nmap-7.91-ncat-unix-sockets.patch b/net-analyzer/nmap/files/nmap-7.91-ncat-unix-sockets.patch new file mode 100644 index 00000000000..f617fd4b134 --- /dev/null +++ b/net-analyzer/nmap/files/nmap-7.91-ncat-unix-sockets.patch @@ -0,0 +1,30 @@ +https://bugs.gentoo.org/765148 +https://github.com/nmap/nmap/commit/f6b40614e4a8131394792d590965f8af3c635323 + +From f6b40614e4a8131394792d590965f8af3c635323 Mon Sep 17 00:00:00 2001 +From: nnposter +Date: Fri, 16 Oct 2020 02:54:52 +0000 +Subject: [PATCH] Fix a Unix domain socket crash. Fixes #2154 + +diff --git a/ncat/ncat_main.c b/ncat/ncat_main.c +index 8942d83cb9..2792a6ac24 100644 +--- a/ncat/ncat_main.c ++++ b/ncat/ncat_main.c +@@ -846,7 +846,7 @@ int main(int argc, char *argv[]) + 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 @@ int main(int argc, char *argv[]) + 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 diff --git a/net-analyzer/nmap/nmap-7.91-r2.ebuild b/net-analyzer/nmap/nmap-7.91-r2.ebuild new file mode 100644 index 00000000000..62abcdf5afc --- /dev/null +++ b/net-analyzer/nmap/nmap-7.91-r2.ebuild @@ -0,0 +1,118 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LUA_COMPAT=( lua5-3 ) +LUA_REQ_USE="deprecated" + +inherit autotools flag-o-matic lua-single toolchain-funcs + +DESCRIPTION="Network exploration tool and security / port scanner" +HOMEPAGE="https://nmap.org/" +SRC_URI="https://nmap.org/dist/${P}.tar.bz2" + +LICENSE="|| ( NPSL GPL-2 )" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" +IUSE="ipv6 libressl libssh2 ncat nping +nse ssl +system-lua" +REQUIRED_USE="system-lua? ( nse ${LUA_REQUIRED_USE} )" + +RDEPEND=" + dev-libs/liblinear:= + dev-libs/libpcre + net-libs/libpcap + libssh2? ( + net-libs/libssh2[zlib] + sys-libs/zlib + ) + nse? ( sys-libs/zlib ) + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:= ) + ) + system-lua? ( ${LUA_DEPS} ) +" +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}"/${PN}-5.10_beta1-string.patch + "${FILESDIR}"/${PN}-5.21-python.patch + "${FILESDIR}"/${PN}-6.46-uninstaller.patch + "${FILESDIR}"/${PN}-6.25-liblua-ar.patch + "${FILESDIR}"/${PN}-7.25-CXXFLAGS.patch + "${FILESDIR}"/${PN}-7.25-libpcre.patch + "${FILESDIR}"/${PN}-7.31-libnl.patch + "${FILESDIR}"/${PN}-7.80-ac-config-subdirs.patch + "${FILESDIR}"/${PN}-7.91-no-FORTIFY_SOURCE.patch + "${FILESDIR}"/${P}-ncat-proxy.patch + "${FILESDIR}"/${P}-ncat-unix-sockets.patch +) + +pkg_setup() { + use system-lua && lua-single_pkg_setup +} + +src_prepare() { + rm -r liblinear/ libpcap/ libpcre/ libssh2/ libz/ || die + + cat "${FILESDIR}"/nls.m4 >> "${S}"/acinclude.m4 || die + + default + + sed -i \ + -e '/^ALL_LINGUAS =/{s|$| id|g;s|jp|ja|g}' \ + Makefile.in || die + + cp libdnet-stripped/include/config.h.in{,.nmap-orig} || die + + eautoreconf + + if [[ ${CHOST} == *-darwin* ]] ; then + # we need the original for a Darwin-specific fix, bug #604432 + mv libdnet-stripped/include/config.h.in{.nmap-orig,} || die + fi +} + +src_configure() { + # The bundled libdnet is incompatible with the version available in the + # tree, so we cannot use the system library here. + econf \ + $(use_enable ipv6) \ + $(use_with libssh2) \ + $(use_with ncat) \ + $(use_with nping) \ + $(use_with ssl openssl) \ + $(usex libssh2 --with-zlib) \ + $(usex nse --with-liblua=$(usex system-lua yes included '' '') --without-liblua) \ + $(usex nse --with-zlib) \ + --cache-file="${S}"/config.cache \ + --with-libdnet=included \ + --with-pcre=/usr \ + --without-ndiff \ + --without-zenmap +} + +src_compile() { + local directory + for directory in . libnetutil nsock/src \ + $(usex ncat ncat '') \ + $(usex nping nping '') + do + emake -C "${directory}" makefile.dep + done + + emake \ + AR=$(tc-getAR) \ + RANLIB=$(tc-getRANLIB) +} + +src_install() { + LC_ALL=C emake -j1 \ + DESTDIR="${D}" \ + STRIP=: \ + nmapdatadir="${EPREFIX}"/usr/share/nmap \ + install + + dodoc CHANGELOG HACKING docs/README docs/*.txt +}