Nmap Development mailing list archives

Re: [NSE] Dependencies not working


From: David Fifield <david () bamsoftware com>
Date: Mon, 13 Dec 2010 08:15:44 -0800

On Mon, Dec 13, 2010 at 10:02:35AM -0600, Ron wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 13 Dec 2010 08:25:35 -0500 Patrick Donnelly <batrick () batbytes com> wrote:
I believe this patch fixes the problem:

batrick@batbytes:~/nmap/svn/nmap$ svn diff
Index: nse_main.lua
===================================================================
--- nse_main.lua        (revision 21299)
+++ nse_main.lua        (working copy)
@@ -962,12 +962,11 @@
     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 @@
         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

Tested the patch, and it looks like it works. 

That looks right. Go ahead and commit it.

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: