mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-05-08 12:30:44 +02:00
nmap: fork and port to python3, https://bugs.gentoo.org/702288
This commit is contained in:
parent
b8dc863865
commit
8a3ca15b50
18 changed files with 2256 additions and 1 deletions
2
net-analyzer/nmap/Manifest
Normal file
2
net-analyzer/nmap/Manifest
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
DIST nmap-7.80.tar.bz2 10550327 BLAKE2B 513a5589f4dd72660d290cc03b8130da2c41e4620c5a82e125e4345259b8d0f6efa8bceef47d3c0d2b5b588888b716070e05105a09b0185622aed9268715ae2c SHA512 d4384d3ebf4f3abf3588eed5433f733874ecdceb9342a718dc36db19634b0cc819d73399974eb0a9a9c9dd9e5c88473e07644ec91db28b0c072552b54430be6b
|
||||||
|
DIST nmap-logo-64.png 3289 BLAKE2B 9563f57d126e6fa38dc777391c2887112836b4f5b521311bde64d5c5a04c45a3f420abba0750f776658015c0018b2afeb381c691bc8784e4f39abc78b9c2d2c7 SHA512 fb102d12aaeebc8a97543ecd653a3606e86996ad679bc26d6e6e274ad05ec3e9f92521289d1a24153c521b699e8c0cfa65d8856bb49af53ee4837268bbc6b5d3
|
||||||
32
net-analyzer/nmap/files/nls.m4
Normal file
32
net-analyzer/nmap/files/nls.m4
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
# nls.m4 serial 5 (gettext-0.18)
|
||||||
|
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 Free Software Foundation,
|
||||||
|
dnl Inc.
|
||||||
|
dnl This file is free software; the Free Software Foundation
|
||||||
|
dnl gives unlimited permission to copy and/or distribute it,
|
||||||
|
dnl with or without modifications, as long as this notice is preserved.
|
||||||
|
dnl
|
||||||
|
dnl This file can be used in projects which are not available under
|
||||||
|
dnl the GNU General Public License or the GNU Library General Public
|
||||||
|
dnl License but which still want to provide support for the GNU gettext
|
||||||
|
dnl functionality.
|
||||||
|
dnl Please note that the actual code of the GNU gettext library is covered
|
||||||
|
dnl by the GNU Library General Public License, and the rest of the GNU
|
||||||
|
dnl gettext package is covered by the GNU General Public License.
|
||||||
|
dnl They are *not* in the public domain.
|
||||||
|
|
||||||
|
dnl Authors:
|
||||||
|
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
|
||||||
|
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
|
||||||
|
|
||||||
|
AC_PREREQ([2.50])
|
||||||
|
|
||||||
|
AC_DEFUN([AM_NLS],
|
||||||
|
[
|
||||||
|
AC_MSG_CHECKING([whether NLS is requested])
|
||||||
|
dnl Default is enabled NLS
|
||||||
|
AC_ARG_ENABLE([nls],
|
||||||
|
[ --disable-nls do not use Native Language Support],
|
||||||
|
USE_NLS=$enableval, USE_NLS=yes)
|
||||||
|
AC_MSG_RESULT([$USE_NLS])
|
||||||
|
AC_SUBST([USE_NLS])
|
||||||
|
])
|
||||||
11
net-analyzer/nmap/files/nmap-5.10_beta1-string.patch
Normal file
11
net-analyzer/nmap/files/nmap-5.10_beta1-string.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
--- nmap-5.10BETA1/Target.h.org 2009-12-08 08:21:59.000000000 +0100
|
||||||
|
+++ nmap-5.10BETA1/Target.h 2009-12-08 08:22:02.000000000 +0100
|
||||||
|
@@ -99,6 +99,8 @@
|
||||||
|
|
||||||
|
#ifndef NOLUA
|
||||||
|
#include "nse_main.h"
|
||||||
|
+#else
|
||||||
|
+#include <string>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "portreasons.h"
|
||||||
21
net-analyzer/nmap/files/nmap-5.21-python.patch
Normal file
21
net-analyzer/nmap/files/nmap-5.21-python.patch
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
diff -Naurp nmap-5.21-orig/Makefile.in nmap-5.21/Makefile.in
|
||||||
|
--- nmap-5.21-orig/Makefile.in 2010-01-31 09:53:53.000000000 +0100
|
||||||
|
+++ nmap-5.21/Makefile.in 2010-01-31 09:54:48.000000000 +0100
|
||||||
|
@@ -253,7 +253,7 @@ build-zenmap: $(ZENMAPDIR)/setup.py $(ZE
|
||||||
|
|
||||||
|
install-zenmap: $(ZENMAPDIR)/setup.py
|
||||||
|
$(INSTALL) -d $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1
|
||||||
|
- cd $(ZENMAPDIR) && $(PYTHON) setup.py --quiet install --prefix "$(prefix)" --force $(if $(DESTDIR),--root "$(DESTDIR)")
|
||||||
|
+ cd $(ZENMAPDIR) && $(PYTHON) setup.py --quiet install --prefix "$(prefix)" --force $(if $(DESTDIR),--root "$(DESTDIR)") --no-compile
|
||||||
|
$(INSTALL) -c -m 644 docs/zenmap.1 $(DESTDIR)$(mandir)/man1/
|
||||||
|
# Create a symlink from nmapfe to zenmap if nmapfe doesn't exist or is
|
||||||
|
# already a link.
|
||||||
|
@@ -267,7 +267,7 @@ build-ndiff:
|
||||||
|
cd $(NDIFFDIR) && $(PYTHON) setup.py build $(if $(DESTDIR),--executable "$(DEFAULT_PYTHON_PATH)")
|
||||||
|
|
||||||
|
install-ndiff:
|
||||||
|
- cd $(NDIFFDIR) && $(PYTHON) setup.py install --prefix "$(prefix)" $(if $(DESTDIR),--root "$(DESTDIR)")
|
||||||
|
+ cd $(NDIFFDIR) && $(PYTHON) setup.py install --prefix "$(prefix)" $(if $(DESTDIR),--root "$(DESTDIR)") --no-compile
|
||||||
|
|
||||||
|
NSE_FILES = scripts/script.db scripts/*.nse
|
||||||
|
NSE_LIB_LUA_FILES = nselib/*.lua
|
||||||
20
net-analyzer/nmap/files/nmap-6.25-liblua-ar.patch
Normal file
20
net-analyzer/nmap/files/nmap-6.25-liblua-ar.patch
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
--- a/liblua/Makefile
|
||||||
|
+++ b/liblua/Makefile
|
||||||
|
@@ -11,7 +11,7 @@
|
||||||
|
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
|
||||||
|
LIBS= -lm $(SYSLIBS) $(MYLIBS)
|
||||||
|
|
||||||
|
-AR= ar rcu
|
||||||
|
+AR= ar
|
||||||
|
RANLIB= ranlib
|
||||||
|
RM= rm -f
|
||||||
|
|
||||||
|
@@ -56,7 +56,7 @@
|
||||||
|
a: $(ALL_A)
|
||||||
|
|
||||||
|
$(LUA_A): $(BASE_O)
|
||||||
|
- $(AR) $@ $(BASE_O)
|
||||||
|
+ $(AR) rcu $@ $(BASE_O)
|
||||||
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
$(LUA_T): $(LUA_O) $(LUA_A)
|
||||||
19
net-analyzer/nmap/files/nmap-6.46-uninstaller.patch
Normal file
19
net-analyzer/nmap/files/nmap-6.46-uninstaller.patch
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
--- a/zenmap/setup.py
|
||||||
|
+++ b/zenmap/setup.py
|
||||||
|
@@ -245,7 +245,6 @@
|
||||||
|
self.set_perms()
|
||||||
|
self.set_modules_path()
|
||||||
|
self.fix_paths()
|
||||||
|
- self.create_uninstaller()
|
||||||
|
self.write_installed_files()
|
||||||
|
|
||||||
|
def get_installed_files(self):
|
||||||
|
@@ -263,8 +262,6 @@
|
||||||
|
os.path.join(self.install_data, data_dir)):
|
||||||
|
for dir in dirs:
|
||||||
|
installed_files.append(os.path.join(dirpath, dir))
|
||||||
|
- installed_files.append(
|
||||||
|
- os.path.join(self.install_scripts, "uninstall_" + APP_NAME))
|
||||||
|
return installed_files
|
||||||
|
|
||||||
|
def create_uninstaller(self):
|
||||||
11
net-analyzer/nmap/files/nmap-7.25-CXXFLAGS.patch
Normal file
11
net-analyzer/nmap/files/nmap-7.25-CXXFLAGS.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
--- a/Makefile.in
|
||||||
|
+++ b/Makefile.in
|
||||||
|
@@ -477,7 +477,7 @@
|
||||||
|
./docs/style/lua-format -i scripts/*.nse
|
||||||
|
|
||||||
|
makefile.dep:
|
||||||
|
- $(CXX) -MM $(CPPFLAGS) $(SRCS) > $@
|
||||||
|
+ $(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) $(SRCS) > $@
|
||||||
|
-include makefile.dep
|
||||||
|
|
||||||
|
# These the old names of scripts that have been renamed or deleted. Any
|
||||||
10
net-analyzer/nmap/files/nmap-7.25-libpcre.patch
Normal file
10
net-analyzer/nmap/files/nmap-7.25-libpcre.patch
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -522,7 +522,6 @@
|
||||||
|
|
||||||
|
# If we still don't have it, we use our own
|
||||||
|
if test $have_pcre != yes ; then
|
||||||
|
- AC_CONFIG_SUBDIRS( libpcre )
|
||||||
|
CPPFLAGS="-I\$(top_srcdir)/$LIBPCREDIR $CPPFLAGS"
|
||||||
|
LIBPCRE_LIBS="$LIBPCREDIR/libpcre.a"
|
||||||
|
PCRE_BUILD="build-pcre"
|
||||||
77
net-analyzer/nmap/files/nmap-7.25-no-FORTIFY_SOURCE.patch
Normal file
77
net-analyzer/nmap/files/nmap-7.25-no-FORTIFY_SOURCE.patch
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
--- a/nbase/Makefile.in
|
||||||
|
+++ b/nbase/Makefile.in
|
||||||
|
@@ -12,7 +12,7 @@
|
||||||
|
CCOPT =
|
||||||
|
DEFS = @DEFS@
|
||||||
|
# With GCC, add extra security checks to source code.
|
||||||
|
-DEFS += -D_FORTIFY_SOURCE=2
|
||||||
|
+DEFS +=
|
||||||
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
CFLAGS = @CFLAGS@ $(CCOPT) $(GLIB_CFLAGS) $(DEFS) $(INCLS)
|
||||||
|
STATIC =
|
||||||
|
--- a/ncat/Makefile.in
|
||||||
|
+++ b/ncat/Makefile.in
|
||||||
|
@@ -53,7 +53,7 @@
|
||||||
|
LIBS = @LIBS@
|
||||||
|
DEFS = @DEFS@ -DNCAT_DATADIR="\"$(pkgdatadir)\""
|
||||||
|
# With GCC, add extra security checks to source code.
|
||||||
|
-DEFS += -D_FORTIFY_SOURCE=2
|
||||||
|
+DEFS +=
|
||||||
|
INCLS = -I. -I.. -I../nsock/include/ -I$(NBASEDIR)
|
||||||
|
RM = rm -f
|
||||||
|
STRIP = @STRIP@
|
||||||
|
--- a/nsock/src/Makefile.in
|
||||||
|
+++ b/nsock/src/Makefile.in
|
||||||
|
@@ -13,7 +13,7 @@
|
||||||
|
CCOPT =
|
||||||
|
DEFS = @DEFS@ -DNSOCK_VERSION=\"$(NSOCK_VERSION)\"
|
||||||
|
# With GCC, add extra security checks to source code.
|
||||||
|
-DEFS += -D_FORTIFY_SOURCE=2
|
||||||
|
+DEFS +=
|
||||||
|
INCLS = -I../include
|
||||||
|
CFLAGS = @CFLAGS@ $(CCOPT)
|
||||||
|
# CFLAGS = -g -Wall $(DEFS) $(INCLS)
|
||||||
|
--- a/libnetutil/Makefile.in
|
||||||
|
+++ b/libnetutil/Makefile.in
|
||||||
|
@@ -5,7 +5,7 @@
|
||||||
|
CXXFLAGS = @CXXFLAGS@
|
||||||
|
CPPFLAGS = @CPPFLAGS@ $(DEFS)
|
||||||
|
DEFS = @DEFS@
|
||||||
|
-DEFS += -D_FORTIFY_SOURCE=2
|
||||||
|
+DEFS +=
|
||||||
|
AR = ar
|
||||||
|
RANLIB = @RANLIB@
|
||||||
|
|
||||||
|
--- a/Makefile.in
|
||||||
|
+++ b/Makefile.in
|
||||||
|
@@ -41,7 +41,7 @@
|
||||||
|
# http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
|
||||||
|
# Level 1 only makes changes that don't affect "conforming" programs,
|
||||||
|
# while level 2 enforces additional restrictions.
|
||||||
|
-DEFS += -D_FORTIFY_SOURCE=2
|
||||||
|
+DEFS +=
|
||||||
|
# For mtrace debugging -- see MTRACE define in main.cc for instructions
|
||||||
|
# Should only be enabled during debugging and not in any real release.
|
||||||
|
# DEFS += -DMTRACE=1
|
||||||
|
--- a/nping/Makefile.in
|
||||||
|
+++ b/nping/Makefile.in
|
||||||
|
@@ -38,7 +38,7 @@
|
||||||
|
# http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
|
||||||
|
# Level 1 only makes changes that don't affect "conforming" programs,
|
||||||
|
# while level 2 enforces additional restrictions.
|
||||||
|
-DEFS += -D_FORTIFY_SOURCE=2
|
||||||
|
+DEFS +=
|
||||||
|
# For mtrace debugging -- see MTRACE define in main.cc for instructions
|
||||||
|
# Should only be enabled during debugging and not in any real release.
|
||||||
|
# DEFS += -DMTRACE=1
|
||||||
|
--- a/nmap-update/Makefile.in
|
||||||
|
+++ b/nmap-update/Makefile.in
|
||||||
|
@@ -12,7 +12,7 @@
|
||||||
|
LDFLAGS = @LDFLAGS@
|
||||||
|
MAC_FLAGS =
|
||||||
|
LIBS = @LIBS@ $(NBASELIB) $(MAC_FLAGS)
|
||||||
|
-DEFS = @DEFS@ -D_FORTIFY_SOURCE=2
|
||||||
|
+DEFS = @DEFS@
|
||||||
|
APR_LIBS = @APR_LIBS@
|
||||||
|
SVN_LIBS = @SVN_LIBS@
|
||||||
|
|
||||||
15
net-analyzer/nmap/files/nmap-7.31-libnl.patch
Normal file
15
net-analyzer/nmap/files/nmap-7.31-libnl.patch
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
nping does not call anything nl_* related so it should not link against libnl (bug #529244)
|
||||||
|
Patching configure.ac would be best but eautoreconf does not handle the subdirs very well.
|
||||||
|
|
||||||
|
--- a/nping/configure.ac
|
||||||
|
+++ b/nping/configure.ac
|
||||||
|
@@ -114,9 +114,6 @@
|
||||||
|
# OpenSSL and NSE C modules can require dlopen
|
||||||
|
AC_SEARCH_LIBS(dlopen, dl)
|
||||||
|
|
||||||
|
-# libpcap can require libnl
|
||||||
|
-AC_SEARCH_LIBS(nl_handle_alloc, nl)
|
||||||
|
-
|
||||||
|
# We test whether they specified openssl desires explicitly
|
||||||
|
use_openssl="yes"
|
||||||
|
specialssldir=""
|
||||||
40
net-analyzer/nmap/files/nmap-7.70-time.patch
Normal file
40
net-analyzer/nmap/files/nmap-7.70-time.patch
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
--- a/nmap_error.cc
|
||||||
|
+++ b/nmap_error.cc
|
||||||
|
@@ -135,6 +135,7 @@
|
||||||
|
#include "xml.h"
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
+#include <time.h>
|
||||||
|
|
||||||
|
extern NmapOps o;
|
||||||
|
|
||||||
|
--- a/nmap.cc
|
||||||
|
+++ b/nmap.cc
|
||||||
|
@@ -161,6 +161,7 @@
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
|
+#include <time.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_PWD_H
|
||||||
|
#include <pwd.h>
|
||||||
|
--- a/osscan2.cc
|
||||||
|
+++ b/osscan2.cc
|
||||||
|
@@ -147,6 +147,7 @@
|
||||||
|
|
||||||
|
#include <list>
|
||||||
|
#include <math.h>
|
||||||
|
+#include <time.h>
|
||||||
|
|
||||||
|
extern NmapOps o;
|
||||||
|
#ifdef WIN32
|
||||||
|
--- a/output.cc
|
||||||
|
+++ b/output.cc
|
||||||
|
@@ -153,6 +153,7 @@
|
||||||
|
#include "libnetutil/netutil.h"
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
+#include <time.h>
|
||||||
|
|
||||||
|
#include <set>
|
||||||
|
#include <vector>
|
||||||
26
net-analyzer/nmap/files/nmap-7.80-ac-config-subdirs.patch
Normal file
26
net-analyzer/nmap/files/nmap-7.80-ac-config-subdirs.patch
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -468,7 +468,6 @@
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $have_libpcap != yes; then
|
||||||
|
- AC_CONFIG_SUBDIRS(libpcap)
|
||||||
|
if test "${LIBPCAP_INC+set}" = "set"; then
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$LIBPCAP_INC"
|
||||||
|
else
|
||||||
|
@@ -611,7 +610,6 @@
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $have_libz != yes; then
|
||||||
|
- AC_CONFIG_SUBDIRS(libz)
|
||||||
|
# TODO: This doesn't work because libssh2's configure script is looking for
|
||||||
|
# already-built libs. Giving up for now: build libz first or install
|
||||||
|
# headers/libs on your own if you want compression support for SSH.
|
||||||
|
@@ -697,7 +695,6 @@
|
||||||
|
# If we still don't have it, we use our own
|
||||||
|
if test $have_libssh2 != yes; then
|
||||||
|
have_libssh2=yes
|
||||||
|
- AC_CONFIG_SUBDIRS(libssh2)
|
||||||
|
CPPFLAGS="-I\$(top_srcdir)/$LIBSSH2DIR/include $CPPFLAGS"
|
||||||
|
LIBSSH2_LIBS="$LIBSSH2DIR/lib/libssh2.a"
|
||||||
|
LIBSSH2_BUILD="build-libssh2"
|
||||||
27
net-analyzer/nmap/files/nmap-7.80-python3-configure.patch
Normal file
27
net-analyzer/nmap/files/nmap-7.80-python3-configure.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
--- a/configure.ac.orig 2019-05-25 02:28:49.000000000 +0800
|
||||||
|
+++ b/configure.ac 2020-01-17 12:31:31.598907767 +0800
|
||||||
|
@@ -230,18 +230,19 @@
|
||||||
|
dnl Check IPv6 raw sending flavor.
|
||||||
|
CHECK_IPV6_IPPROTO_RAW
|
||||||
|
|
||||||
|
-m4_define_default([_AM_PYTHON_INTERPRETER_LIST],[python2 python2.7 python2.6 python2.5 python2.4 python])
|
||||||
|
-AM_PATH_PYTHON([2.4], [HAVE_PYTHON=true], [HAVE_PYTHON=false])
|
||||||
|
+m4_define_default([_AM_PYTHON_INTERPRETER_LIST],[python3 python3.8 python3.7 python3.6 python3.5 python])
|
||||||
|
+AM_PATH_PYTHON([3.5], [HAVE_PYTHON=true], [HAVE_PYTHON=false])
|
||||||
|
HAVE_PYTHON2=false
|
||||||
|
-if test $HAVE_PYTHON && test "x${PYTHON_VERSION%%.*}" = "x2"; then
|
||||||
|
- HAVE_PYTHON2=true
|
||||||
|
+HAVE_PYTHON3=false
|
||||||
|
+if test $HAVE_PYTHON && test "x${PYTHON_VERSION%%.*}" = "x3"; then
|
||||||
|
+ HAVE_PYTHON3=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
NDIFFDIR=ndiff
|
||||||
|
|
||||||
|
# Do they want Ndiff?
|
||||||
|
AC_ARG_WITH(ndiff, AC_HELP_STRING([--without-ndiff], [Skip installation of the Ndiff utility]), [], [with_ndiff=check])
|
||||||
|
-if $HAVE_PYTHON2 ; then : ;
|
||||||
|
+if $HAVE_PYTHON3 ; then : ;
|
||||||
|
else
|
||||||
|
if test "$with_ndiff" = "check" ; then
|
||||||
|
AC_MSG_WARN([Not building Ndiff because Python 2.x with x>=4 was not found])
|
||||||
1715
net-analyzer/nmap/files/nmap-7.80-python3-port-of-ndiff.patch
Normal file
1715
net-analyzer/nmap/files/nmap-7.80-python3-port-of-ndiff.patch
Normal file
File diff suppressed because it is too large
Load diff
22
net-analyzer/nmap/files/nmap-9999-constify-continued.patch
Normal file
22
net-analyzer/nmap/files/nmap-9999-constify-continued.patch
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
--- a/libnetutil/EthernetHeader.cc
|
||||||
|
+++ b/libnetutil/EthernetHeader.cc
|
||||||
|
@@ -284,7 +284,7 @@ int EthernetHeader::setEtherType(u16 val){
|
||||||
|
|
||||||
|
|
||||||
|
/** Returns destination port in HOST byte order */
|
||||||
|
-u16 EthernetHeader::getEtherType() const {
|
||||||
|
+const u16 EthernetHeader::getEtherType() const {
|
||||||
|
return ntohs(this->h.eth_type);
|
||||||
|
} /* End of getEtherType() */
|
||||||
|
|
||||||
|
--- a/scan_engine.cc
|
||||||
|
+++ b/scan_engine.cc
|
||||||
|
@@ -166,7 +166,7 @@ extern "C" int g_has_npcap_loopback;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
-int HssPredicate::operator() (const HostScanStats *lhs, const HostScanStats *rhs) const {
|
||||||
|
+const int HssPredicate::operator() (const HostScanStats *lhs, const HostScanStats *rhs) const {
|
||||||
|
const struct sockaddr_storage *lss, *rss;
|
||||||
|
lss = (lhs) ? lhs->target->TargetSockAddr() : ss;
|
||||||
|
rss = (rhs) ? rhs->target->TargetSockAddr() : ss;
|
||||||
20
net-analyzer/nmap/files/nmap-9999-netutil-else.patch
Normal file
20
net-analyzer/nmap/files/nmap-9999-netutil-else.patch
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
--- a/libnetutil/netutil.cc
|
||||||
|
+++ b/libnetutil/netutil.cc
|
||||||
|
@@ -2571,7 +2571,7 @@ const char *ippackethdrinfo(const u8 *packet, u32 len, int detail) {
|
||||||
|
|
||||||
|
/* CASE 4: where we (finally!) have a full 20 byte TCP header so we can
|
||||||
|
* safely print all fields */
|
||||||
|
- else { /* if (datalen >= 20) */
|
||||||
|
+ else if (datalen >= 20) {
|
||||||
|
|
||||||
|
/* TCP Flags */
|
||||||
|
p = tflags;
|
||||||
|
@@ -2633,7 +2633,7 @@ const char *ippackethdrinfo(const u8 *packet, u32 len, int detail) {
|
||||||
|
(tcpoptinfo[0]!='\0') ? " " : "",
|
||||||
|
tcpoptinfo, ipinfo);
|
||||||
|
}
|
||||||
|
- } else{
|
||||||
|
+ } else {
|
||||||
|
/* If the packet does not fall into any other category, then we have a
|
||||||
|
really screwed-up packet. */
|
||||||
|
/* This ought to be unreachable; if static analysis flags it as such, delete it. */
|
||||||
187
net-analyzer/nmap/nmap-7.80-r1.ebuild
Normal file
187
net-analyzer/nmap/nmap-7.80-r1.ebuild
Normal file
|
|
@ -0,0 +1,187 @@
|
||||||
|
# Copyright 1999-2020 Gentoo Authors
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
|
EAPI=7
|
||||||
|
|
||||||
|
#https://bugs.gentoo.org/702288
|
||||||
|
PYTHON_COMPAT=( python3_{6,7} )
|
||||||
|
PYTHON_REQ_USE="sqlite,xml"
|
||||||
|
|
||||||
|
inherit autotools desktop flag-o-matic python-single-r1 toolchain-funcs user
|
||||||
|
|
||||||
|
MY_P=${P/_beta/BETA}
|
||||||
|
|
||||||
|
DESCRIPTION="A utility for network discovery and security auditing"
|
||||||
|
HOMEPAGE="https://nmap.org/"
|
||||||
|
SRC_URI="
|
||||||
|
https://nmap.org/dist/${MY_P}.tar.bz2
|
||||||
|
https://dev.gentoo.org/~jer/nmap-logo-64.png
|
||||||
|
"
|
||||||
|
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
|
||||||
|
|
||||||
|
LICENSE="GPL-2"
|
||||||
|
SLOT="0"
|
||||||
|
|
||||||
|
IUSE="ipv6 libressl libssh2 ncat ndiff nls nmap-update nping +nse ssl system-lua"
|
||||||
|
# zenmap
|
||||||
|
|
||||||
|
#NMAP_LINGUAS=( de fr hi hr it ja pl pt_BR ru zh )
|
||||||
|
REQUIRED_USE="
|
||||||
|
system-lua? ( nse )
|
||||||
|
ndiff? ( ${PYTHON_REQUIRED_USE} )"
|
||||||
|
# zenmap? ( ${PYTHON_REQUIRED_USE} )
|
||||||
|
|
||||||
|
RDEPEND="
|
||||||
|
dev-libs/liblinear:=
|
||||||
|
dev-libs/libpcre
|
||||||
|
net-libs/libpcap
|
||||||
|
libssh2? (
|
||||||
|
net-libs/libssh2[zlib]
|
||||||
|
sys-libs/zlib
|
||||||
|
)
|
||||||
|
ndiff? ( ${PYTHON_DEPS} )
|
||||||
|
nls? ( virtual/libintl )
|
||||||
|
nmap-update? (
|
||||||
|
dev-libs/apr
|
||||||
|
dev-vcs/subversion
|
||||||
|
)
|
||||||
|
nse? ( sys-libs/zlib )
|
||||||
|
ssl? (
|
||||||
|
!libressl? ( dev-libs/openssl:0= )
|
||||||
|
libressl? ( dev-libs/libressl:= )
|
||||||
|
)
|
||||||
|
system-lua? ( >=dev-lang/lua-5.2:*[deprecated] )
|
||||||
|
"
|
||||||
|
# zenmap? (
|
||||||
|
# dev-python/pygtk:2[${PYTHON_USEDEP}]
|
||||||
|
# ${PYTHON_DEPS}
|
||||||
|
# )
|
||||||
|
|
||||||
|
DEPEND="
|
||||||
|
${RDEPEND}
|
||||||
|
nls? ( sys-devel/gettext )
|
||||||
|
"
|
||||||
|
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-no-FORTIFY_SOURCE.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.80-python3-port-of-ndiff.patch
|
||||||
|
"${FILESDIR}"/${PN}-7.80-python3-configure.patch
|
||||||
|
)
|
||||||
|
S="${WORKDIR}/${MY_P}"
|
||||||
|
|
||||||
|
pkg_setup() {
|
||||||
|
if use ndiff; then
|
||||||
|
python-single-r1_pkg_setup
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
rm -r liblinear/ libpcap/ libpcre/ libssh2/ libz/ || die
|
||||||
|
|
||||||
|
cat "${FILESDIR}"/nls.m4 >> "${S}"/acinclude.m4 || die
|
||||||
|
|
||||||
|
default
|
||||||
|
|
||||||
|
# local lingua
|
||||||
|
# if use nls; then
|
||||||
|
# for lingua in ${NMAP_LINGUAS[@]}; do
|
||||||
|
# if ! has ${lingua} ${LINGUAS-${lingua}}; then
|
||||||
|
# rm -r zenmap/share/zenmap/locale/${lingua} || die
|
||||||
|
# rm zenmap/share/zenmap/locale/${lingua}.po || die
|
||||||
|
# fi
|
||||||
|
# done
|
||||||
|
# else
|
||||||
|
# # configure/make ignores --disable-nls
|
||||||
|
# for lingua in ${NMAP_LINGUAS[@]}; do
|
||||||
|
# rm -r zenmap/share/zenmap/locale/${lingua} || die
|
||||||
|
# rm zenmap/share/zenmap/locale/${lingua}.po || die
|
||||||
|
# done
|
||||||
|
# fi
|
||||||
|
|
||||||
|
sed -i \
|
||||||
|
-e '/^ALL_LINGUAS =/{s|$| id|g;s|jp|ja|g}' \
|
||||||
|
Makefile.in || die
|
||||||
|
# Fix desktop files wrt bug #432714
|
||||||
|
# sed -i \
|
||||||
|
# -e 's|^Categories=.*|Categories=Network;System;Security;|g' \
|
||||||
|
# zenmap/install_scripts/unix/zenmap-root.desktop \
|
||||||
|
# zenmap/install_scripts/unix/zenmap.desktop || 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_enable nls) \
|
||||||
|
$(use_with libssh2) \
|
||||||
|
$(use_with ncat) \
|
||||||
|
$(use_with ndiff) \
|
||||||
|
$(use_with nmap-update) \
|
||||||
|
$(use_with nping) \
|
||||||
|
$(use_with ssl openssl) \
|
||||||
|
$(usex libssh2 --with-zlib) \
|
||||||
|
$(usex nse --with-zlib) \
|
||||||
|
$(usex nse --with-liblua=$(usex system-lua /usr included '' '') --without-liblua) \
|
||||||
|
--cache-file="${S}"/config.cache \
|
||||||
|
--with-libdnet=included \
|
||||||
|
--with-pcre=/usr
|
||||||
|
# Commented out because configure does weird things
|
||||||
|
# --with-liblinear=/usr \
|
||||||
|
# $(use_with zenmap) \
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
local directory
|
||||||
|
for directory in . libnetutil nsock/src \
|
||||||
|
$(usex ncat ncat '') \
|
||||||
|
$(usex nmap-update nmap-update '') \
|
||||||
|
$(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
|
||||||
|
if use nmap-update;then
|
||||||
|
LC_ALL=C emake -j1 \
|
||||||
|
-C nmap-update \
|
||||||
|
DESTDIR="${D}" \
|
||||||
|
STRIP=: \
|
||||||
|
nmapdatadir="${EPREFIX}"/usr/share/nmap \
|
||||||
|
install
|
||||||
|
fi
|
||||||
|
|
||||||
|
dodoc CHANGELOG HACKING docs/README docs/*.txt
|
||||||
|
|
||||||
|
# if use zenmap; then
|
||||||
|
# doicon "${DISTDIR}/nmap-logo-64.png"
|
||||||
|
# python_optimize
|
||||||
|
# fi
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
net-analyzer/ettercap plugins
|
net-analyzer/ettercap plugins
|
||||||
net-analyzer/metasploit pcaprub
|
net-analyzer/metasploit pcaprub
|
||||||
net-analyzer/nmap ipv6 lua nping gtk python zenmap
|
net-analyzer/nmap ipv6 lua nping ndiff
|
||||||
net-analyzer/rrdtool -ruby graph
|
net-analyzer/rrdtool -ruby graph
|
||||||
net-analyzer/scapy gnuplot tcpreplay
|
net-analyzer/scapy gnuplot tcpreplay
|
||||||
net-analyzer/snort dynamicplugin zlib
|
net-analyzer/snort dynamicplugin zlib
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue