1
0
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:
djalal
2010-06-12 21:41:09 +00:00
parent 62c2d97f93
commit 24807128d2
5 changed files with 193 additions and 179 deletions

View File

@@ -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