From 84340f5737f026a1d0533efb39fd2d433fc740b6 Mon Sep 17 00:00:00 2001 From: fyodor Date: Wed, 3 Jan 2007 20:46:14 +0000 Subject: [PATCH] Fixed a bug which prevented the --without-liblua compilation option from working. Thanks to Kris Katterjohn for the patch. --- CHANGELOG | 3 +++ nmap.cc | 8 ++++++++ output.cc | 6 +++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index b0a4e7c7c..53ed2370a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -21,6 +21,9 @@ o Fix nmap.xsl (the transform for rendering Nmap XML results as HTML) to fix some bugs related to OS detection output. Thanks to Tom Sellers for the patch. +o Fixed a bug which prevented the --without-liblua compilation option + from working. Thanks to Kris Katterjohn for the patch. + o Applied a bunch of code cleanup patches from Kris Katterjohn. o Applied some internal bugfix patches from Eddie Bell. diff --git a/nmap.cc b/nmap.cc index b9e132350..91f337265 100644 --- a/nmap.cc +++ b/nmap.cc @@ -738,7 +738,9 @@ int nmap_main(int argc, char *argv[]) { o.osscan_guess = 1; } else if (optcmp(long_options[option_index].name, "packet-trace") == 0) { o.setPacketTrace(true); +#ifndef NOLUA o.scripttrace = 1; +#endif } else if (optcmp(long_options[option_index].name, "version-trace") == 0) { o.setVersionTrace(true); o.debugging++; @@ -832,7 +834,9 @@ int nmap_main(int argc, char *argv[]) { break; case 'A': o.servicescan = true; +#ifndef NOLUA o.script = 1; +#endif if (o.isr00t) o.osscan = OS_SCAN_DEFAULT; break; @@ -1435,11 +1439,13 @@ int nmap_main(int argc, char *argv[]) { // if (num_host_exp_groups == 0) // fatal("No target machines/networks specified!"); +#ifndef NOLUA if(o.scriptupdatedb) { script_updatedb(); // disable warnings o.max_ips_to_scan = o.numhosts_scanned; } +#endif hstate = new HostGroupState(o.ping_group_sz, o.randomize_hosts, host_exp_group, num_host_exp_groups); @@ -1604,7 +1610,9 @@ int nmap_main(int argc, char *argv[]) { if (o.servicescan) { o.current_scantype = SERVICE_SCAN; +#ifndef NOLUA o.scriptversion = 1; +#endif keyWasPressed(); // Check if a status message should be printed service_scan(Targets); diff --git a/output.cc b/output.cc index 8eb99fee7..c7389531e 100644 --- a/output.cc +++ b/output.cc @@ -1691,7 +1691,11 @@ void printfinaloutput() { gettimeofday(&tv, NULL); timep = time(NULL); - if (o.numhosts_scanned == 0 && o.scriptupdatedb == 0) + if (o.numhosts_scanned == 0 +#ifndef NOLUA + && o.scriptupdatedb == 0 +#endif + ) fprintf(stderr, "WARNING: No targets were specified, so 0 hosts scanned.\n"); if (o.numhosts_scanned == 1 && o.numhosts_up == 0 && !o.listscan && o.pingtype != PINGTYPE_NONE)