diff --git a/backport-remove-nse_pcrelib-from-build.patch b/backport-remove-nse_pcrelib-from-build.patch index 2bdfa37..ed89337 100644 --- a/backport-remove-nse_pcrelib-from-build.patch +++ b/backport-remove-nse_pcrelib-from-build.patch @@ -6,35 +6,34 @@ Subject: [PATCH] Remove nse_pcrelib from build. Conflict: NA Reference: https://github.com/nmap/nmap/commit/d131a096a869195be36ef7d4fa36739373346cb2 --- - Makefile.in | 6 +++--- - mswin32/nmap.vcxproj | 2 -- - nse_main.cc | 2 -- - nse_main.lua | 2 +- - nselib/unittest.lua | 1 - - 5 files changed, 4 insertions(+), 9 deletions(-) + Makefile.in | 6 +++--- + nse_main.cc | 2 -- + nse_main.lua | 2 +- + nselib/unittest.lua | 1 - + 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Makefile.in b/Makefile.in -index ccfceda..8c19056 100644 +index 2b13e86..a924301 100644 --- a/Makefile.in +++ b/Makefile.in @@ -88,9 +88,9 @@ UNINSTALLNDIFF=@UNINSTALLNDIFF@ UNINSTALLNPING=@UNINSTALLNPING@ ifneq (@NOLUA@,yes) --NSE_SRC=nse_main.cc nse_utility.cc nse_nsock.cc nse_dnet.cc nse_fs.cc nse_nmaplib.cc nse_debug.cc nse_pcrelib.cc nse_lpeg.cc --NSE_HDRS=nse_main.h nse_utility.h nse_nsock.h nse_dnet.h nse_fs.h nse_nmaplib.h nse_debug.h nse_pcrelib.h nse_lpeg.h --NSE_OBJS=nse_main.o nse_utility.o nse_nsock.o nse_dnet.o nse_fs.o nse_nmaplib.o nse_debug.o nse_pcrelib.o nse_lpeg.o -+NSE_SRC=nse_main.cc nse_utility.cc nse_nsock.cc nse_dnet.cc nse_fs.cc nse_nmaplib.cc nse_debug.cc nse_lpeg.cc -+NSE_HDRS=nse_main.h nse_utility.h nse_nsock.h nse_dnet.h nse_fs.h nse_nmaplib.h nse_debug.h nse_lpeg.h -+NSE_OBJS=nse_main.o nse_utility.o nse_nsock.o nse_dnet.o nse_fs.o nse_nmaplib.o nse_debug.o nse_lpeg.o +-NSE_SRC=nse_main.cc nse_utility.cc nse_nsock.cc nse_db.cc nse_dnet.cc nse_fs.cc nse_nmaplib.cc nse_debug.cc nse_pcrelib.cc nse_lpeg.cc +-NSE_HDRS=nse_main.h nse_utility.h nse_nsock.h nse_db.h nse_dnet.h nse_fs.h nse_nmaplib.h nse_debug.h nse_pcrelib.h nse_lpeg.h +-NSE_OBJS=nse_main.o nse_utility.o nse_nsock.o nse_db.o nse_dnet.o nse_fs.o nse_nmaplib.o nse_debug.o nse_pcrelib.o nse_lpeg.o ++NSE_SRC=nse_main.cc nse_utility.cc nse_nsock.cc nse_db.cc nse_dnet.cc nse_fs.cc nse_nmaplib.cc nse_debug.cc nse_lpeg.cc ++NSE_HDRS=nse_main.h nse_utility.h nse_nsock.h nse_db.h nse_dnet.h nse_fs.h nse_nmaplib.h nse_debug.h nse_lpeg.h ++NSE_OBJS=nse_main.o nse_utility.o nse_nsock.o nse_db.o nse_dnet.o nse_fs.o nse_nmaplib.o nse_debug.o nse_lpeg.o ifneq (@OPENSSL_LIBS@,) NSE_SRC+=nse_openssl.cc nse_ssl_cert.cc NSE_HDRS+=nse_openssl.h nse_ssl_cert.h diff --git a/nse_main.cc b/nse_main.cc -index 110291f..b946c7c 100644 +index d5d460e..2382688 100644 --- a/nse_main.cc +++ b/nse_main.cc -@@ -14,7 +14,6 @@ +@@ -15,7 +15,6 @@ #include "nse_fs.h" #include "nse_nsock.h" #include "nse_nmaplib.h" @@ -42,19 +41,19 @@ index 110291f..b946c7c 100644 #include "nse_openssl.h" #include "nse_debug.h" #include "nse_lpeg.h" -@@ -557,7 +556,6 @@ static int panic (lua_State *L) +@@ -562,7 +561,6 @@ static int panic (lua_State *L) static void set_nmap_libraries (lua_State *L) { static const luaL_Reg libs[] = { - {NSE_PCRELIBNAME, luaopen_pcrelib}, {NSE_NMAPLIBNAME, luaopen_nmap}, + {NSE_DBLIBNAME, luaopen_db}, {LFSLIBNAME, luaopen_lfs}, - {LPEGLIBNAME, luaopen_lpeg}, diff --git a/nse_main.lua b/nse_main.lua -index af5f611..7fba46e 100644 +index 24c9d2a..596aba9 100644 --- a/nse_main.lua +++ b/nse_main.lua -@@ -285,7 +285,7 @@ local REQUIRE_ERROR = {}; +@@ -292,7 +292,7 @@ local REQUIRE_ERROR = {}; rawset(stdnse, "silent_require", function (...) local status, mod = pcall(require, ...); if not status then @@ -64,7 +63,7 @@ index af5f611..7fba46e 100644 else return mod; diff --git a/nselib/unittest.lua b/nselib/unittest.lua -index ac90c31..d780b85 100644 +index b22de05..aaf5fce 100644 --- a/nselib/unittest.lua +++ b/nselib/unittest.lua @@ -107,7 +107,6 @@ local libs = { @@ -75,6 +74,3 @@ index ac90c31..d780b85 100644 "pgsql", "pop3", "pppoe", --- -2.33.0 - diff --git a/backport-upgrade-libpcre-to-PCRE2-10.42.patch b/backport-upgrade-libpcre-to-PCRE2-10.42.patch index fe64726..fb6aac2 100644 --- a/backport-upgrade-libpcre-to-PCRE2-10.42.patch +++ b/backport-upgrade-libpcre-to-PCRE2-10.42.patch @@ -24,21 +24,21 @@ Reference: https://github.com/nmap/nmap/commit/828ab48764b82d0226e860c73c5dac5b1 delete mode 100644 nselib/pcre.luadoc diff --git a/checklibs.sh b/checklibs.sh -index ff58326..6483358 100644 +index 2048e2a..26e9d8a 100644 --- a/checklibs.sh +++ b/checklibs.sh @@ -11,13 +11,13 @@ trim_version() { } check_libpcre() { -- PCRE_SOURCE="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/" +- PCRE_SOURCE="https://sourceforge.net/projects/pcre/files/latest/download" + PCRE_SOURCE="https://github.com/PCRE2Project/pcre2/releases/latest" PCRE_MAJOR="" PCRE_MINOR="" - eval $(grep '^PCRE_MAJOR=' $NDIR/libpcre/configure) - eval $(grep '^PCRE_MINOR=' $NDIR/libpcre/configure) - PCRE_VERSION="$PCRE_MAJOR.$PCRE_MINOR" -- PCRE_LATEST=$(curl -ls $PCRE_SOURCE | perl -lne 'if(/pcre-(\d+.\d+).tar.gz$/){print $1}' | newest) +- PCRE_LATEST=$(curl -s -I $PCRE_SOURCE | perl -lne 'if(/pcre-(\d+.\d+).zip/){print $1}' | newest) + eval $(grep '^PCRE2_MAJOR=' $NDIR/libpcre/configure) + eval $(grep '^PCRE2_MINOR=' $NDIR/libpcre/configure) + PCRE_VERSION="$PCRE2_MAJOR.$PCRE2_MINOR" @@ -47,7 +47,7 @@ index ff58326..6483358 100644 echo "Newer version of libpcre available" echo " Current:" $PCRE_VERSION diff --git a/configure b/configure -index f8e1358..26cb1f6 100755 +index d1d2f19..12764ee 100755 --- a/configure +++ b/configure @@ -1451,8 +1451,8 @@ Optional Packages: @@ -61,7 +61,7 @@ index f8e1358..26cb1f6 100755 --with-libpcre=included Always use the version included with Nmap --with-libz=DIR Use specific copy of libz --with-libz=included Always use version included with Nmap -@@ -6421,58 +6421,19 @@ fi +@@ -6437,58 +6437,19 @@ fi # If they didn't specify it, we try to find it if test $have_pcre != yes -a $requested_included_pcre != yes ; then @@ -128,7 +128,7 @@ index f8e1358..26cb1f6 100755 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -@@ -6482,35 +6443,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -6498,35 +6459,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif @@ -171,7 +171,7 @@ index f8e1358..26cb1f6 100755 fi -@@ -6520,8 +6476,8 @@ fi +@@ -6536,8 +6492,8 @@ fi if test $have_pcre != yes ; then subdirs="$subdirs libpcre" @@ -182,7 +182,7 @@ index f8e1358..26cb1f6 100755 PCRE_BUILD="build-pcre" PCRE_CLEAN="clean-pcre" PCRE_DIST_CLEAN="distclean-pcre" -@@ -6530,19 +6486,19 @@ $as_echo "#define PCRE_INCLUDED 1" >>confdefs.h +@@ -6546,19 +6502,19 @@ $as_echo "#define PCRE_INCLUDED 1" >>confdefs.h else # We only need to check for and use this if we are NOT using included pcre @@ -208,10 +208,10 @@ index f8e1358..26cb1f6 100755 PCRE_CLEAN="" PCRE_DIST_CLEAN="" diff --git a/configure.ac b/configure.ac -index ac123af..6e695f3 100644 +index 7835d9b..c25fb04 100644 --- a/configure.ac +++ b/configure.ac -@@ -507,7 +507,7 @@ LIBPCREDIR=libpcre +@@ -510,7 +510,7 @@ LIBPCREDIR=libpcre # First we test whether they specified libpcre explicitly AC_ARG_WITH(libpcre, @@ -220,7 +220,7 @@ index ac123af..6e695f3 100644 AC_HELP_STRING([--with-libpcre=included], [Always use the version included with Nmap]), [ case "$with_libpcre" in yes) -@@ -525,27 +525,28 @@ AC_HELP_STRING([--with-libpcre=included], [Always use the version included with +@@ -528,27 +528,28 @@ AC_HELP_STRING([--with-libpcre=included], [Always use the version included with # If they didn't specify it, we try to find it if test $have_pcre != yes -a $requested_included_pcre != yes ; then @@ -260,10 +260,10 @@ index ac123af..6e695f3 100644 PCRE_CLEAN="" PCRE_DIST_CLEAN="" diff --git a/nmap.cc b/nmap.cc -index f1b8bf9..62984a5 100644 +index e4c65e7..96f0230 100644 --- a/nmap.cc +++ b/nmap.cc -@@ -2764,10 +2764,12 @@ static void display_nmap_version() { +@@ -2803,10 +2803,12 @@ static void display_nmap_version() { without.push_back("libz"); #endif @@ -279,10 +279,10 @@ index f1b8bf9..62984a5 100644 #ifdef WIN32 diff --git a/nmap_config.h.in b/nmap_config.h.in -index c9ac750..10fdda9 100644 +index 67dbeda..1dae65a 100644 --- a/nmap_config.h.in +++ b/nmap_config.h.in -@@ -105,8 +105,6 @@ +@@ -103,8 +103,6 @@ #undef HAVE_TERMIOS_H @@ -292,10 +292,10 @@ index c9ac750..10fdda9 100644 #undef IN_ADDR_DEEPSTRUCT diff --git a/nping/nping_config.h.in b/nping/nping_config.h.in -index 9d4ccb4..2e4377f 100644 +index 98638cb..9b6f971 100644 --- a/nping/nping_config.h.in +++ b/nping/nping_config.h.in -@@ -103,8 +103,6 @@ +@@ -101,8 +101,6 @@ #undef HAVE_TERMIOS_H @@ -867,10 +867,10 @@ index c442a96..0000000 --- local n = regex:gmatch("string to be searched", match) -function pcre_obj:gmatch(string, func, n, ef) diff --git a/service_scan.cc b/service_scan.cc -index 66e0d92..8b57d9a 100644 +index cf13d8b..473b3a6 100644 --- a/service_scan.cc +++ b/service_scan.cc -@@ -247,7 +247,7 @@ ServiceProbeMatch::ServiceProbeMatch() { +@@ -250,7 +250,7 @@ ServiceProbeMatch::ServiceProbeMatch() { product_template = version_template = info_template = NULL; hostname_template = ostype_template = devicetype_template = NULL; regex_compiled = NULL; @@ -879,10 +879,10 @@ index 66e0d92..8b57d9a 100644 isInitialized = false; matchops_ignorecase = false; matchops_dotall = false; -@@ -268,8 +268,21 @@ ServiceProbeMatch::~ServiceProbeMatch() { +@@ -269,8 +269,21 @@ ServiceProbeMatch::~ServiceProbeMatch() { + if (devicetype_template) free(devicetype_template); for (it = cpe_templates.begin(); it != cpe_templates.end(); it++) free(*it); - matchstrlen = 0; - if (regex_compiled) pcre_free(regex_compiled); - if (regex_extra) pcre_free(regex_extra); + if (regex_compiled) @@ -901,12 +901,12 @@ index 66e0d92..8b57d9a 100644 + match_context=NULL; + } isInitialized = false; - matchops_anchor = -1; } -@@ -347,9 +360,9 @@ static bool next_template(const char **matchtext, char **modestr, char **tmplt, - void ServiceProbeMatch::InitMatch(const char *matchtext, int lineno) { - const char *p; - char *modestr, *tmptemplate, *flags; + +@@ -350,9 +363,9 @@ void ServiceProbeMatch::InitMatch(const char *matchtext, int lineno) { + char *tmptemplate; + char modestr[4]; + char flags[4]; - int pcre_compile_ops = 0; - const char *pcre_errptr = NULL; - int pcre_erroffset = 0; @@ -916,7 +916,7 @@ index 66e0d92..8b57d9a 100644 char **curr_tmp = NULL; if (isInitialized) fatal("Sorry ... %s does not yet support reinitializion", __func__); -@@ -405,38 +418,40 @@ void ServiceProbeMatch::InitMatch(const char *matchtext, int lineno) { +@@ -405,41 +418,42 @@ void ServiceProbeMatch::InitMatch(const char *matchtext, int lineno) { // Next we compile and study the regular expression to match if (matchops_ignorecase) @@ -935,7 +935,7 @@ index 66e0d92..8b57d9a 100644 if (regex_compiled == NULL) - fatal("%s: illegal regexp on line %d of nmap-service-probes (at regexp offset %d): %s\n", __func__, lineno, pcre_erroffset, pcre_errptr); + fatal("%s: illegal regexp on line %d of nmap-service-probes (at regexp offset %ld): %d\n", __func__, lineno, pcre2_erroffset, pcre2_errcode); - + - // Now study the regexp for greater efficiency - regex_extra = pcre_study(regex_compiled, 0 -#ifdef PCRE_STUDY_EXTRA_NEEDED @@ -977,16 +977,18 @@ index 66e0d92..8b57d9a 100644 + pcre2_set_recursion_limit(match_context, 10000); #endif - free(modestr); -@@ -502,7 +517,6 @@ const struct MatchDetails *ServiceProbeMatch::testMatch(const u8 *buf, int bufle +- + /* OK! Now we look for any templates of the form ?/.../ + * where ? is either p, v, i, h, o, or d. / is any + * delimiter character and ... is a template */ +@@ -509,34 +523,29 @@ const struct MatchDetails *ServiceProbeMatch::testMatch(const u8 *buf, int bufle static char devicetype[32]; static char cpe_a[80], cpe_h[80], cpe_o[80]; char *bufc = (char *) buf; - int ovector[150]; // allows 50 substring matches (including the overall match) assert(isInitialized); - assert (matchtype == SERVICEMATCH_REGEX); -@@ -511,27 +525,23 @@ const struct MatchDetails *ServiceProbeMatch::testMatch(const u8 *buf, int bufle + // Clear out the output struct memset(&MD_return, 0, sizeof(MD_return)); MD_return.isSoft = isSoft; @@ -1019,7 +1021,7 @@ index 66e0d92..8b57d9a 100644 hostname, sizeof(hostname), ostype, sizeof(ostype), devicetype, sizeof(devicetype), cpe_a, sizeof(cpe_a), cpe_h, sizeof(cpe_h), cpe_o, sizeof(cpe_o)); if (*product) MD_return.product = product; -@@ -680,18 +690,17 @@ static char *transform_cpe(const char *s) { +@@ -685,18 +694,17 @@ static char *transform_cpe(const char *s) { // This function does the substitution of a placeholder like $2 or $P(4). It // returns a newly allocated string, or NULL if it fails. tmplvar is a template // variable, such as "$P(2)". We set *tmplvarend to the character after the @@ -1043,7 +1045,7 @@ index 66e0d92..8b57d9a 100644 struct substargs command_args; char *result; size_t n, len; -@@ -723,6 +732,8 @@ static char *substvar(char *tmplvar, char **tmplvarend, +@@ -728,6 +736,8 @@ static char *substvar(char *tmplvar, char **tmplvarend, } if (tmplvarend) *tmplvarend = tmplvar; @@ -1052,7 +1054,7 @@ index 66e0d92..8b57d9a 100644 strbuf_init(&result, &n, &len); if (!*substcommand) { -@@ -730,9 +741,10 @@ static char *substvar(char *tmplvar, char **tmplvarend, +@@ -735,9 +745,10 @@ static char *substvar(char *tmplvar, char **tmplvarend, if (subnum > 9 || subnum <= 0) return NULL; if (subnum >= nummatches) return NULL; offstart = ovector[subnum * 2]; @@ -1065,7 +1067,7 @@ index 66e0d92..8b57d9a 100644 // A plain-jane copy strbuf_append(&result, &n, &len, (const char *) subject + offstart, offend - offstart); } else if (strcmp(substcommand, "P") == 0) { -@@ -744,13 +756,14 @@ static char *substvar(char *tmplvar, char **tmplvarend, +@@ -749,13 +760,14 @@ static char *substvar(char *tmplvar, char **tmplvarend, if (subnum > 9 || subnum <= 0) return NULL; if (subnum >= nummatches) return NULL; offstart = ovector[subnum * 2]; @@ -1083,7 +1085,7 @@ index 66e0d92..8b57d9a 100644 if (isprint((int) subject[i])) strbuf_append(&result, &n, &len, (const char *) subject + i, 1); } -@@ -767,14 +780,15 @@ static char *substvar(char *tmplvar, char **tmplvarend, +@@ -772,14 +784,15 @@ static char *substvar(char *tmplvar, char **tmplvarend, if (subnum > 9 || subnum <= 0) return NULL; if (subnum >= nummatches) return NULL; offstart = ovector[subnum * 2]; @@ -1102,7 +1104,7 @@ index 66e0d92..8b57d9a 100644 if (memcmp(subject + i, findstr, findstrlen) != 0) { strbuf_append(&result, &n, &len, (const char *) subject + i, 1); // no match i++; -@@ -800,8 +814,9 @@ static char *substvar(char *tmplvar, char **tmplvarend, +@@ -805,8 +818,9 @@ static char *substvar(char *tmplvar, char **tmplvarend, if (subnum > 9 || subnum <= 0) return NULL; if (subnum >= nummatches) return NULL; offstart = ovector[subnum * 2]; @@ -1113,7 +1115,7 @@ index 66e0d92..8b57d9a 100644 // overflow if (offend - offstart > 8) { -@@ -819,11 +834,11 @@ static char *substvar(char *tmplvar, char **tmplvarend, +@@ -824,11 +838,11 @@ static char *substvar(char *tmplvar, char **tmplvarend, break; } if (bigendian) { @@ -1127,7 +1129,7 @@ index 66e0d92..8b57d9a 100644 val = (val<<8) + subject[i]; } } -@@ -842,16 +857,16 @@ static char *substvar(char *tmplvar, char **tmplvarend, +@@ -847,16 +861,16 @@ static char *substvar(char *tmplvar, char **tmplvarend, // This function takes a template string (tmpl) which can have // placeholders in it such as $1 for substring matches in a regexp @@ -1148,7 +1150,7 @@ index 66e0d92..8b57d9a 100644 int newstrlen, char *(*transform)(const char *) = NULL) { int newlen; -@@ -890,7 +905,7 @@ static int dotmplsubst(const u8 *subject, int subjectlen, +@@ -895,7 +909,7 @@ static int dotmplsubst(const u8 *subject, int subjectlen, dst += newlen; } srcstart = srcend; @@ -1157,7 +1159,7 @@ index 66e0d92..8b57d9a 100644 if (subst == NULL) return -1; /* Apply transformation if requested. */ -@@ -932,14 +947,14 @@ static int dotmplsubst(const u8 *subject, int subjectlen, +@@ -937,14 +951,14 @@ static int dotmplsubst(const u8 *subject, int subjectlen, // for a string, that string will have zero length after the function // call (assuming the corresponding length passed in is at least 1) @@ -1180,7 +1182,7 @@ index 66e0d92..8b57d9a 100644 int rc; assert(productlen >= 0 && versionlen >= 0 && infolen >= 0 && -@@ -958,9 +973,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, +@@ -963,9 +977,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, // Now lets get this started! We begin with the product name if (product_template) { @@ -1192,7 +1194,7 @@ index 66e0d92..8b57d9a 100644 (product_template)? product_template : "", (version_template)? version_template : "", (info_template)? info_template : ""); -@@ -970,9 +985,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, +@@ -975,9 +989,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, } if (version_template) { @@ -1204,7 +1206,7 @@ index 66e0d92..8b57d9a 100644 (product_template)? product_template : "", (version_template)? version_template : "", (info_template)? info_template : ""); -@@ -982,9 +997,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, +@@ -987,9 +1001,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, } if (info_template) { @@ -1216,7 +1218,7 @@ index 66e0d92..8b57d9a 100644 (product_template)? product_template : "", (version_template)? version_template : "", (info_template)? info_template : ""); -@@ -994,9 +1009,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, +@@ -999,9 +1013,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, } if (hostname_template) { @@ -1228,7 +1230,7 @@ index 66e0d92..8b57d9a 100644 (hostname_template)? hostname_template : ""); if (hostnamelen > 0) *hostname = '\0'; retval = -1; -@@ -1004,9 +1019,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, +@@ -1009,9 +1023,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, } if (ostype_template) { @@ -1240,7 +1242,7 @@ index 66e0d92..8b57d9a 100644 (ostype_template)? ostype_template : ""); if (ostypelen > 0) *ostype = '\0'; retval = -1; -@@ -1014,9 +1029,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, +@@ -1019,9 +1033,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, } if (devicetype_template) { @@ -1252,7 +1254,7 @@ index 66e0d92..8b57d9a 100644 (devicetype_template)? devicetype_template : ""); if (devicetypelen > 0) *devicetype = '\0'; retval = -1; -@@ -1027,7 +1042,7 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, +@@ -1032,7 +1046,7 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, store in cpe_a, cpe_h, or cpe_o as appropriate. */ for (unsigned int i = 0; i < cpe_templates.size(); i++) { char *cpe; @@ -1261,7 +1263,7 @@ index 66e0d92..8b57d9a 100644 int part; part = cpe_get_part(cpe_templates[i]); -@@ -1050,9 +1065,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, +@@ -1055,9 +1069,9 @@ int ServiceProbeMatch::getVersionStr(const u8 *subject, int subjectlen, continue; break; } @@ -1274,10 +1276,10 @@ index 66e0d92..8b57d9a 100644 if (cpelen > 0) *cpe = '\0'; retval = -1; diff --git a/service_scan.h b/service_scan.h -index de2dfad..650a891 100644 +index 7723d81..8ebdee7 100644 --- a/service_scan.h +++ b/service_scan.h -@@ -71,16 +71,8 @@ +@@ -69,16 +69,8 @@ #include @@ -1296,10 +1298,10 @@ index de2dfad..650a891 100644 #undef NDEBUG #include -@@ -162,8 +154,9 @@ class ServiceProbeMatch { - int matchtype; // SERVICEMATCH_REGEX or SERVICESCAN_STATIC - char *matchstr; // Regular expression text, or static string - int matchstrlen; // Because static strings may have embedded NULs +@@ -155,8 +147,9 @@ class ServiceProbeMatch { + bool isInitialized; // Has InitMatch yet been called? + const char *servicename; + char *matchstr; // Regular expression text - pcre *regex_compiled; - pcre_extra *regex_extra; + pcre2_code *regex_compiled; @@ -1308,7 +1310,7 @@ index de2dfad..650a891 100644 bool matchops_ignorecase; bool matchops_dotall; bool isSoft; // is this a soft match? ("softmatch" keyword in nmap-service-probes) -@@ -189,14 +182,14 @@ class ServiceProbeMatch { +@@ -179,14 +172,14 @@ class ServiceProbeMatch { // are sufficient). Returns zero for success. If no template is available // for a string, that string will have zero length after the function // call (assuming the corresponding length passed in is at least 1) @@ -1331,6 +1333,3 @@ index de2dfad..650a891 100644 }; --- -2.33.0 - diff --git a/nmap-7.92.tar.bz2 b/nmap-7.94.tar.bz2 similarity index 55% rename from nmap-7.92.tar.bz2 rename to nmap-7.94.tar.bz2 index 7b37e21..1ceb39c 100644 Binary files a/nmap-7.92.tar.bz2 and b/nmap-7.94.tar.bz2 differ diff --git a/nmap.spec b/nmap.spec index 230a781..bfad1ec 100644 --- a/nmap.spec +++ b/nmap.spec @@ -2,8 +2,8 @@ Name: nmap Epoch: 2 -Version: 7.92 -Release: 5 +Version: 7.94 +Release: 1 License: Nmap Summary: A tool for network discovery and security auditing. Requires: %{name}-ncat = %{epoch}:%{version}-%{release} @@ -33,7 +33,7 @@ auditing. It was designed to rapidly scan large networks, but works fine against %prep %autosetup -n %{name}-%{version} -p1 -rm -rf libpcap macosx mswin32 libssh2 libz +rm -rf libpcap libpcre macosx mswin32 libssh2 libz %build export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" @@ -68,6 +68,12 @@ ln -s ncat %{buildroot}%{_bindir}/nc %{_mandir}/man1/*.1.gz %changelog +* Thu Jul 27 2023 xingwei - 2:7.94-1 +- Type:requirement +- ID:NA +- SUG:NA +- DESC:update nmap to 7.94 + * Thu Jul 06 2023 xingwei - 2:7.92-5 - Type:bugfix - CVE: