1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-26 01:19:03 +00:00

Clean debug messages and make debug level 3 the default debug level for the 'adding new targets' code.

This commit is contained in:
djalal
2010-09-03 17:53:34 +00:00
parent 299b8e8f28
commit c9a756bc12
3 changed files with 13 additions and 10 deletions

View File

@@ -83,16 +83,16 @@ add = function (...)
-- Force the check here, but it would be better if scripts
-- check ALLOW_NEW_TARGETS before calling target.add()
if not ALLOW_NEW_TARGETS then
stdnse.print_debug(3,
"Error: to add targets run with --script-args 'newtargets'")
return false, "Error: to add targets run with --script-args 'newtargets'"
stdnse.print_debug(1,
"ERROR: to add targets run with --script-args 'newtargets'")
return false, "to add targets run with --script-args 'newtargets'"
end
local new_targets = {count = select("#", ...), ...}
-- function called without arguments
if new_targets.count == 0 then
return true, nmap.add_targets()
return true, nmap.add_targets()
end
new_targets.count = calc_max_targets(new_targets.count)
@@ -100,7 +100,7 @@ add = function (...)
if new_targets.count == 0 then
stdnse.print_debug(3,
"Warning: Maximum new targets reached, no more new targets.")
return false, "Warning: Maximum new targets reached, no more new targets."
return false, "Maximum new targets reached, no more new targets."
end
local hosts, err = nmap.add_targets(unpack(new_targets,1,new_targets.count))