mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Avoid empty rules interpreted as all scripts in the script dir.
This commit is contained in:
parent
7f2b6d2eb4
commit
3a7f446b90
1 changed files with 7 additions and 6 deletions
13
nse_main.lua
13
nse_main.lua
|
|
@ -723,13 +723,14 @@ local function get_chosen_scripts (rules)
|
|||
|
||||
for i, rule in ipairs(rules) do
|
||||
rule = match(rule, "^%s*(.-)%s*$"); -- strip surrounding whitespace
|
||||
local original_rule = rule;
|
||||
local forced, rule = is_forced_set(rule);
|
||||
used_rules[rule] = false; -- has not been used yet
|
||||
forced_rules[rule] = forced;
|
||||
-- Here we escape backslashes which might appear in Windows filenames.
|
||||
rule = gsub(rule, "\\([^\\])", "\\\\%1");
|
||||
rules[i] = rule;
|
||||
if rule and rule ~= "" then
|
||||
used_rules[rule] = false; -- has not been used yet
|
||||
forced_rules[rule] = forced;
|
||||
-- Here we escape backslashes which might appear in Windows filenames.
|
||||
rule = gsub(rule, "\\([^\\])", "\\\\%1");
|
||||
rules[i] = rule;
|
||||
end
|
||||
end
|
||||
|
||||
-- Checks if a given script, script_entry, should be loaded. A script_entry
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue