nmap: update to 7.92

This commit is contained in:
Yaksh Bariya 2022-01-26 14:26:09 +05:30 committed by YAKSH BARIYA
parent 791a60338f
commit f05fc8698e
9 changed files with 101 additions and 99 deletions

View File

@ -2,14 +2,13 @@ TERMUX_PKG_HOMEPAGE=https://nmap.org/
TERMUX_PKG_DESCRIPTION="Utility for network discovery and security auditing"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=7.91
TERMUX_PKG_REVISION=3
TERMUX_PKG_VERSION=7.92
TERMUX_PKG_SRCURL=https://nmap.org/dist/nmap-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_SHA256=18cc4b5070511c51eb243cdd2b0b30ff9b2c4dc4544c6312f75ce3a67a593300
TERMUX_PKG_SHA256=a5479f2f8a6b0b2516767d2f7189c386c1dc858d997167d7ec5cfc798c7571a1
TERMUX_PKG_DEPENDS="libc++, libpcap, pcre, openssl, resolv-conf, liblua53, libssh2, zlib"
TERMUX_PKG_RECOMMENDS="nmap-ncat"
# --without-nmap-update to avoid linking against libsvn_client:
# --without-zenmap to avoid python scripts for graphical gtk frontend:
# --without-ndiff to avoid python2-using ndiff utility:
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_path_STRIP=llvm-strip --enable-static --with-liblua=$TERMUX_PREFIX --without-nmap-update --without-zenmap --without-ndiff"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_BUILD_IN_SRC=true

View File

@ -1,90 +0,0 @@
diff -uNr nmap-7.70/ncat/ncat_connect.c nmap-7.70.mod/ncat/ncat_connect.c
--- nmap-7.70/ncat/ncat_connect.c 2018-01-28 23:18:17.000000000 +0200
+++ nmap-7.70.mod/ncat/ncat_connect.c 2019-03-02 01:35:44.977992954 +0200
@@ -1005,7 +1005,7 @@
char *tmpdir = getenv("TMPDIR");
size_t size=0, offset=0;
strbuf_sprintf(&tmp_name, &size, &offset, "%s/ncat.XXXXXX",
- tmpdir ? tmpdir : "/tmp");
+ tmpdir ? tmpdir : "@TERMUX_PREFIX@/tmp");
if (mkstemp(tmp_name) == -1) {
bye("Failed to create name for temporary DGRAM source Unix domain socket (mkstemp).");
}
diff -uNr nmap-7.70/ncat/ncat_main.c nmap-7.70.mod/ncat/ncat_main.c
--- nmap-7.70/ncat/ncat_main.c 2018-03-05 03:53:34.000000000 +0200
+++ nmap-7.70.mod/ncat/ncat_main.c 2019-03-02 01:35:44.977992954 +0200
@@ -999,8 +999,8 @@
#ifndef WIN32
/* See if the shell is executable before we get deep into this */
- if (o.execmode == EXEC_SHELL && access("/bin/sh", X_OK) == -1)
- bye("/bin/sh is not executable, so `-c' won't work.");
+ if (o.execmode == EXEC_SHELL && access("@TERMUX_PREFIX@/bin/sh", X_OK) == -1)
+ bye("@TERMUX_PREFIX@/bin/sh is not executable, so `-c' won't work.");
#endif
if (targetaddrs->addr.storage.ss_family != AF_UNSPEC) {
diff -uNr nmap-7.70/ncat/ncat_posix.c nmap-7.70.mod/ncat/ncat_posix.c
--- nmap-7.70/ncat/ncat_posix.c 2018-01-28 23:18:17.000000000 +0200
+++ nmap-7.70.mod/ncat/ncat_posix.c 2019-03-02 01:35:44.981326300 +0200
@@ -239,7 +239,7 @@
char **cmdargs;
case EXEC_SHELL:
- execl("/bin/sh", "sh", "-c", cmdexec, (void *) NULL);
+ execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", cmdexec, (void *) NULL);
break;
#ifdef HAVE_LUA
case EXEC_LUA:
diff -uNr nmap-7.70/nmap_dns.cc nmap-7.70.mod/nmap_dns.cc
--- nmap-7.70/nmap_dns.cc 2018-01-28 23:18:17.000000000 +0200
+++ nmap-7.70.mod/nmap_dns.cc 2019-03-02 01:35:44.981326300 +0200
@@ -1016,9 +1016,9 @@
char fmt[32];
char ipaddr[INET6_ADDRSTRLEN+1];
- fp = fopen("/etc/resolv.conf", "r");
+ fp = fopen("@TERMUX_PREFIX@/etc/resolv.conf", "r");
if (fp == NULL) {
- if (firstrun) error("mass_dns: warning: Unable to open /etc/resolv.conf. Try using --system-dns or specify valid servers with --dns-servers");
+ if (firstrun) error("mass_dns: warning: Unable to open $PREFIX/etc/resolv.conf. Try using --system-dns or specify valid servers with --dns-servers");
return;
}
@@ -1099,7 +1099,7 @@
parse_etchosts(tpbuf);
#else
- parse_etchosts("/etc/hosts");
+ parse_etchosts("@TERMUX_PREFIX@/etc/hosts");
#endif // WIN32
}
diff -uNr nmap-7.70/protocols.cc nmap-7.70.mod/protocols.cc
--- nmap-7.70/protocols.cc 2018-01-28 23:18:17.000000000 +0200
+++ nmap-7.70.mod/protocols.cc 2019-03-02 01:37:23.878379187 +0200
@@ -156,8 +156,8 @@
int res;
if (nmap_fetchfile(filename, sizeof(filename), "nmap-protocols") != 1) {
- error("Unable to find nmap-protocols! Resorting to /etc/protocols");
- strcpy(filename, "/etc/protocols");
+ error("Unable to find nmap-protocols! Resorting to @TERMUX_PREFIX@/etc/protocols");
+ strcpy(filename, "@TERMUX_PREFIX@/etc/protocols");
}
fp = fopen(filename, "r");
diff -uNr nmap-7.70/services.cc nmap-7.70.mod/services.cc
--- nmap-7.70/services.cc 2018-01-28 23:18:17.000000000 +0200
+++ nmap-7.70.mod/services.cc 2019-03-02 01:36:46.291565552 +0200
@@ -202,8 +202,8 @@
if (nmap_fetchfile(filename, sizeof(filename), "nmap-services") != 1) {
#ifndef WIN32
- error("Unable to find nmap-services! Resorting to /etc/services");
- strcpy(filename, "/etc/services");
+ error("Unable to find nmap-services! Resorting to @TERMUX_PREFIX@/etc/services");
+ strcpy(filename, "@TERMUX_PREFIX@/etc/services");
#else
int len, wnt = GetVersion() < 0x80000000;
error("Unable to find nmap-services! Resorting to /etc/services");

View File

@ -0,0 +1,11 @@
--- ./ncat/ncat_connect.c.orig 2022-01-26 14:17:18.457352337 +0530
+++ ./ncat/ncat_connect.c 2022-01-26 14:19:24.273745882 +0530
@@ -1032,7 +1032,7 @@
char *tmpdir = getenv("TMPDIR");
size_t size=0, offset=0;
strbuf_sprintf(&tmp_name, &size, &offset, "%s/ncat.XXXXXX",
- tmpdir ? tmpdir : "/tmp");
+ tmpdir ? tmpdir : "@TERMUX_PREFIX@/tmp");
if (mkstemp(tmp_name) == -1) {
bye("Failed to create name for temporary DGRAM source Unix domain socket (mkstemp).");
}

View File

@ -0,0 +1,22 @@
--- ./ncat/ncat_main.c.orig 2022-01-26 14:12:51.857352439 +0530
+++ ./ncat/ncat_main.c 2022-01-26 14:12:54.947352437 +0530
@@ -588,7 +588,7 @@
" --vsock Use vsock sockets only\n"
#endif
" -C, --crlf Use CRLF for EOL sequence\n"
-" -c, --sh-exec <command> Executes the given command via /bin/sh\n"
+" -c, --sh-exec <command> Executes the given command via @TERMUX_PREFIX@/bin/sh\n"
" -e, --exec <command> Executes the given command\n"
#ifdef HAVE_LUA
" --lua-exec <filename> Executes the given Lua script\n"
@@ -1043,8 +1043,8 @@
#ifndef WIN32
/* See if the shell is executable before we get deep into this */
- if (o.execmode == EXEC_SHELL && access("/bin/sh", X_OK) == -1)
- bye("/bin/sh is not executable, so `-c' won't work.");
+ if (o.execmode == EXEC_SHELL && access("@TERMUX_PREFIX@/bin/sh", X_OK) == -1)
+ bye("@TERMUX_PREFIX@/bin/sh is not executable, so `-c' won't work.");
#endif
if (targetaddrs->addr.storage.ss_family != AF_UNSPEC) {

View File

@ -0,0 +1,11 @@
--- ./ncat/ncat_posix.c.orig 2022-01-26 14:14:21.327352404 +0530
+++ ./ncat/ncat_posix.c 2022-01-26 14:14:24.577352403 +0530
@@ -171,7 +171,7 @@
char **cmdargs;
case EXEC_SHELL:
- execl("/bin/sh", "sh", "-c", cmdexec, (void *) NULL);
+ execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", cmdexec, (void *) NULL);
break;
#ifdef HAVE_LUA
case EXEC_LUA:

View File

@ -0,0 +1,23 @@
--- ./nmap_dns.cc.orig 2022-01-26 13:52:53.711929205 +0530
+++ ./nmap_dns.cc 2022-01-26 13:54:22.651929171 +0530
@@ -948,9 +948,9 @@
char fmt[32];
char ipaddr[INET6_ADDRSTRLEN+1];
- fp = fopen("/etc/resolv.conf", "r");
+ fp = fopen("@TERMUX_PREFIX@/etc/resolv.conf", "r");
if (fp == NULL) {
- if (firstrun) gh_perror("mass_dns: warning: Unable to open /etc/resolv.conf. Try using --system-dns or specify valid servers with --dns-servers");
+ if (firstrun) gh_perror("mass_dns: warning: Unable to open @TERMUX_PREFIX@/etc/resolv.conf. Try using --system-dns or specify valid servers with --dns-servers");
return;
}
@@ -1031,7 +1031,7 @@
parse_etchosts(tpbuf);
#else
- parse_etchosts("/etc/hosts");
+ parse_etchosts("@TERMUX_PREFIX@/etc/hosts");
#endif // WIN32
}

View File

@ -1,7 +1,6 @@
diff -u -r ../nmap-7.70/nping/EchoServer.cc ./nping/EchoServer.cc
--- ../nmap-7.70/nping/EchoServer.cc 2018-01-28 21:18:17.000000000 +0000
+++ ./nping/EchoServer.cc 2018-09-21 06:35:10.405423943 +0000
@@ -281,12 +281,12 @@
--- ./nping/EchoServer.cc.orig 2022-01-26 14:21:26.416061668 +0530
+++ ./nping/EchoServer.cc 2022-01-26 14:21:47.086061660 +0530
@@ -213,12 +213,12 @@
server_addr6.sin6_len = sizeof(struct sockaddr_in6);
#endif
/* Bind to local address and the specified port */
@ -16,7 +15,7 @@ diff -u -r ../nmap-7.70/nping/EchoServer.cc ./nping/EchoServer.cc
nping_fatal(QT_3, "Could not bind to port %d (%s).", port, strerror(errno));
}else{
nping_print(VB_1, "Server bound to port %d", port);
@@ -319,12 +319,12 @@
@@ -251,12 +251,12 @@
#endif
/* Bind to local address and the specified port */

View File

@ -0,0 +1,13 @@
--- ./protocols.cc.orig 2022-01-26 13:59:35.461929052 +0530
+++ ./protocols.cc 2022-01-26 13:58:31.191929077 +0530
@@ -87,8 +87,8 @@
int res;
if (nmap_fetchfile(filename, sizeof(filename), "nmap-protocols") != 1) {
- error("Unable to find nmap-protocols! Resorting to /etc/protocols");
- strcpy(filename, "/etc/protocols");
+ error("Unable to find nmap-protocols! Resorting to @TERMUX_PREFIX@/etc/protocols");
+ strcpy(filename, "@TERMUX_PREFIX@/etc/protocols");
}
fp = fopen(filename, "r");

View File

@ -0,0 +1,14 @@
--- ./services.cc.orig 2022-01-26 14:02:23.951928988 +0530
+++ ./services.cc 2022-01-26 14:03:01.921928973 +0530
@@ -133,9 +133,9 @@
ratio_format = 0;
if (nmap_fetchfile(filename, sizeof(filename), "nmap-services") != 1) {
- error("Unable to find nmap-services! Resorting to /etc/services");
+ error("Unable to find nmap-services! Resorting to @TERMUX_PREFIX@/etc/services");
#ifndef WIN32
- strcpy(filename, "/etc/services");
+ strcpy(filename, "@TERMUX_PREFIX@/etc/services");
#else
int len = GetSystemDirectory(filename, 480); // be safe
if(!len)