1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Make some change to make --without-liblua work again.

This commit is contained in:
david
2008-08-05 19:28:51 +00:00
parent deeaaf9e77
commit 9621ab338a
4 changed files with 10 additions and 3 deletions

View File

@@ -462,9 +462,11 @@ void NmapOps::ValidateOptions() {
if(ipoptions && osscan)
error("WARNING: Ip options are NOT used while OS scanning!");
#ifndef NOLUA
/* Make sure nmap.registry.args is available (even if it's empty) */
if (!scriptargs)
scriptargs = strdup("");
#endif
}
void NmapOps::setMaxOSTries(int mot) {

View File

@@ -1631,7 +1631,11 @@ int nmap_main(int argc, char *argv[]) {
if (currenths->flags & HOST_UP && !o.listscan)
o.numhosts_up++;
if ((o.pingscan && !o.traceroute && !o.script) || o.listscan) {
if ((o.pingscan && !o.traceroute
#ifndef NOLUA
&& !o.script
#endif
) || o.listscan) {
/* We're done with the hosts */
log_write(LOG_XML, "<host>");
write_host_status(currenths, o.resolve_all);
@@ -1909,7 +1913,9 @@ void nmap_free_mem() {
if (o.dns_servers) free(o.dns_servers);
if (o.extra_payload) free(o.extra_payload);
if (o.ipoptions) free(o.ipoptions);
#ifndef NOLUA
free(o.scriptargs);
#endif
}
/* Reads in a (normal or machine format) Nmap log file and gathers enough

View File

@@ -836,7 +836,7 @@ log_write(LOG_PLAIN, "%d service%s unrecognized despite returning data. If you k
}
#ifndef NOLUA
char* formatScriptOutput(ScriptResult sr) {
static char* formatScriptOutput(ScriptResult sr) {
std::string result = std::string(), output = sr.get_output();
string::size_type pos;
char *c_result, *c_output = new char[output.length()+1];

View File

@@ -196,7 +196,6 @@ void printosscanoutput(Target *currenths);
void printserviceinfooutput(Target *currenths);
void printhostscriptresults(Target *currenths);
char* formatScriptOutput(ScriptResult sr);
/* Print a detailed list of Nmap interfaces and routes to
normal/skiddy/stdout output */