From 48b604bcd2eb9f10adf71c42b4e5615eaed86a14 Mon Sep 17 00:00:00 2001 From: batrick Date: Sun, 12 May 2013 21:24:16 +0000 Subject: [PATCH] The directory path was being passed to Script.new rather than the file in the directory. This bug was reported by Robin Wood [1]. [1] http://seclists.org/nmap-dev/2013/q2/282 --- nse_main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nse_main.lua b/nse_main.lua index 99bd4de1d..4cae3f03e 100644 --- a/nse_main.lua +++ b/nse_main.lua @@ -786,9 +786,9 @@ local function get_chosen_scripts (rules) elseif t == "directory" then for f in lfs.dir(path) do local file = path .."/".. f - if find(f, "%.nse$") and not files_loaded[file] then + if find(file, "%.nse$") and not files_loaded[file] then script_params.selection = "directory"; - local script = Script.new(path, script_params); + local script = Script.new(file, script_params); chosen_scripts[#chosen_scripts+1] = script; files_loaded[file] = true; end