mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Don't call math.ceil on script runlevels; allow them to be
floating-point.
This commit is contained in:
parent
7903fc92bf
commit
316c21e2e4
1 changed files with 3 additions and 5 deletions
|
|
@ -58,8 +58,6 @@ local traceback = debug.traceback;
|
|||
|
||||
local write = io.write;
|
||||
|
||||
local ceil = math.ceil;
|
||||
|
||||
local byte = string.byte;
|
||||
local format = string.format;
|
||||
local find = string.find;
|
||||
|
|
@ -168,7 +166,7 @@ do
|
|||
local thread = setmetatable({
|
||||
co = co,
|
||||
env = env,
|
||||
runlevel = ceil(tonumber(rawget(env, "runlevel")) or 1),
|
||||
runlevel = tonumber(rawget(env, "runlevel")) or 1,
|
||||
identifier = tostring(co),
|
||||
info = format("'%s' (%s)", self.short_basename, tostring(co));
|
||||
type = rule == "hostrule" and "host" or "port",
|
||||
|
|
@ -242,7 +240,7 @@ do
|
|||
categories = rawget(env, "categories"),
|
||||
author = rawget(env, "author"),
|
||||
license = rawget(env, "license"),
|
||||
runlevel = ceil(tonumber(rawget(env, "runlevel")) or 1),
|
||||
runlevel = tonumber(rawget(env, "runlevel")) or 1,
|
||||
threads = {},
|
||||
}, {__index = Script, __metatable = Script});
|
||||
end
|
||||
|
|
@ -554,7 +552,7 @@ return function (hosts)
|
|||
|
||||
sort(runlevels);
|
||||
for i, runlevel in ipairs(runlevels) do
|
||||
print_verbose(1, "Starting runlevel %s scan", tostring(runlevel));
|
||||
print_verbose(1, "Starting runlevel %g scan", runlevel);
|
||||
run(threads[runlevel]);
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue