From 5855504a358abd08b4f36adcdbd0c65ffa6a25c8 Mon Sep 17 00:00:00 2001 From: batrick Date: Wed, 13 May 2009 06:39:50 +0000 Subject: [PATCH] [NSE] Fixed a bug I just found where NSE would report that a --script expression did not match files when it did. This happens when an expression matches a set of scripts that were loaded by other expressions first. A simple example is the same expression with different capitalization (considered to be two different expressions): batrick@waterdeep:~/nmap/svn/nmap$ ./nmap -d2 -v --script default,DEFAULT localhost > /dev/null NSE: failed to initialize the script engine: ./nse_main.lua:365: 'DEFAULT' did not match a category, filename, or directory stack traceback: [C]: in function 'error' ./nse_main.lua:365: in function 'get_chosen_scripts' ./nse_main.lua:498: in main chunk [C]: ? QUITTING! --- nse_main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nse_main.lua b/nse_main.lua index ee38844a0..953d38968 100644 --- a/nse_main.lua +++ b/nse_main.lua @@ -344,9 +344,9 @@ local function get_chosen_scripts (rules) assert(t == "file", filename.." is not a file!"); if not files_loaded[path] then chosen_scripts[#chosen_scripts+1] = Script.new(path); - used_rules[rule_table.original_rule] = true; files_loaded[path] = true; end + used_rules[rule_table.original_rule] = true; end end end