mirror of
https://github.com/nmap/nmap.git
synced 2025-12-16 04:39:03 +00:00
Merge r17640:18062 from /nmap-exp/djalal/nmap, this is a port of the LuaFileSystem directory iterator in order to use Lua code to list scripts.
This commit is contained in:
@@ -469,8 +469,9 @@ local function get_chosen_scripts (rules)
|
||||
print_debug(2, "Script %s was selected by name.", script.filename);
|
||||
files_loaded[path] = true;
|
||||
elseif t == "directory" then
|
||||
for i, file in ipairs(cnse.dump_dir(path)) do
|
||||
if not files_loaded[file] then
|
||||
for f in cnse.dir(path) do
|
||||
local file = path .."/".. f
|
||||
if find(f, "%.nse$") and not files_loaded[file] then
|
||||
chosen_scripts[#chosen_scripts+1] = Script.new(file);
|
||||
files_loaded[file] = true;
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user