1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-26 09:29:01 +00:00

A warning is printed when a script in the script database cannot be located

using nmap_fetchfile. Nmap no longer exits due to this error.
This commit is contained in:
batrick
2009-05-17 19:48:46 +00:00
parent fc6d15eb4f
commit 4a5bdd4a13

View File

@@ -340,13 +340,18 @@ local function get_chosen_scripts (rules)
for globalized_rule, rule_table in pairs(entry_rules) do
if setfenv(rule_table.compiled_rule, env)() then -- run the compiled rule
local t, path = cnse.fetchfile_absolute(filename);
assert(t == "file", filename.." is not a file!");
if not files_loaded[path] then
chosen_scripts[#chosen_scripts+1] = Script.new(path);
files_loaded[path] = true;
end
used_rules[rule_table.original_rule] = true;
local t, path = cnse.fetchfile_absolute(filename);
if t == "file" then
if not files_loaded[path] then
chosen_scripts[#chosen_scripts+1] = Script.new(path);
files_loaded[path] = true;
-- do not break so other rules can be marked as used
end
else
log_error("Warning: Could not load '%s': %s", filename, path);
break;
end
end
end
end