Fixed an issue in script dependencies that caused the later scripts to begin without waiting for the earlier scripts to finish. Patch written by Patrick Donneley.

This commit is contained in:
ron 2010-12-13 16:22:14 +00:00
parent 00652cb231
commit 3ded2339e8

View file

@ -962,12 +962,11 @@ local function main (hosts, scantype)
end);
end
-- This iterator is passed to the run function. It returns one new script
-- thread on demand until exhausted.
local function threads_iter ()
-- activate prerule scripts
for runlevel, scripts in ipairs(runlevels) do
print_verbose(1, "Starting runlevel %u (of %u) scan.", runlevel, #runlevels);
for runlevel, scripts in ipairs(runlevels) do
-- This iterator is passed to the run function. It returns one new script
-- thread on demand until exhausted.
local function threads_iter ()
-- activate prerule scripts
if (scantype == NSE_PRE_SCAN) then
print_verbose(1, "Script Pre-scanning.");
for script in runlevel_scripts(scripts) do
@ -1017,10 +1016,10 @@ local function main (hosts, scantype)
end
end
end
print_verbose(1, "Starting runlevel %u (of %u) scan.", runlevel, #runlevels);
run(wrap(threads_iter), scantype)
end
run(wrap(threads_iter), scantype)
collectgarbage "collect";
end