mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
Re-indent some libs and scripts, change 4 to 2-space indent
Mostly found with:
for i in nselib/*.lua scripts/*.nse; do
echo $(perl -lne 'BEGIN{$a=$p=0}next unless $_;/^(\s*)/;' \
-e '$l=length$1;next if$l==$p;$a+=(abs($l-$p)-$a)/$.;' \
-e '$p=$l;END{print$a}' $i) $i
done | sort -nr
And indented with: https://gist.github.com/bonsaiviking/8845871
whois-ip.nse was particularly mangled (probably my fault due to using
vim's built-in indentation script, but it could be structured better)
This commit is contained in:
@@ -54,25 +54,25 @@ portrule = shortport.port_or_service( {80, 443}, {"http", "https"}, "tcp", "open
|
||||
|
||||
local function loadFingerprints(filename, cat)
|
||||
|
||||
local file, fingerprints
|
||||
local file, fingerprints
|
||||
|
||||
-- Find the file
|
||||
filename = nmap.fetchfile('nselib/data/' .. filename) or filename
|
||||
-- Find the file
|
||||
filename = nmap.fetchfile('nselib/data/' .. filename) or filename
|
||||
|
||||
-- Load the file
|
||||
stdnse.print_debug(1, "%s: Loading fingerprints: %s", SCRIPT_NAME, filename)
|
||||
local env = setmetatable({fingerprints = {}}, {__index = _G});
|
||||
file = loadfile(filename, "t", env)
|
||||
-- Load the file
|
||||
stdnse.print_debug(1, "%s: Loading fingerprints: %s", SCRIPT_NAME, filename)
|
||||
local env = setmetatable({fingerprints = {}}, {__index = _G});
|
||||
file = loadfile(filename, "t", env)
|
||||
|
||||
if( not(file) ) then
|
||||
stdnse.print_debug(1, "%s: Couldn't load the file: %s", SCRIPT_NAME, filename)
|
||||
return
|
||||
end
|
||||
if( not(file) ) then
|
||||
stdnse.print_debug(1, "%s: Couldn't load the file: %s", SCRIPT_NAME, filename)
|
||||
return
|
||||
end
|
||||
|
||||
file()
|
||||
fingerprints = env.tools
|
||||
file()
|
||||
fingerprints = env.tools
|
||||
|
||||
return fingerprints
|
||||
return fingerprints
|
||||
|
||||
end
|
||||
|
||||
@@ -92,10 +92,10 @@ action = function(host, port)
|
||||
end
|
||||
|
||||
local crawler = httpspider.Crawler:new(host, port, '/', { scriptname = SCRIPT_NAME,
|
||||
maxpagecount = 40,
|
||||
maxdepth = -1,
|
||||
withinhost = 1
|
||||
})
|
||||
maxpagecount = 40,
|
||||
maxdepth = -1,
|
||||
withinhost = 1
|
||||
})
|
||||
|
||||
if rapid then
|
||||
return "Couldn't determine the underlying framework or CMS. Try turning off 'rapid' mode."
|
||||
|
||||
Reference in New Issue
Block a user