add recursion limit

bug/bundler_fix
Brent Cook 2015-05-04 03:59:31 -05:00
parent 7ff3044552
commit f42334414a
1 changed files with 8 additions and 2 deletions

View File

@ -386,7 +386,13 @@ class Console::CommandDispatcher::Stdapi::Fs
alias cmd_getlwd cmd_lpwd
def list_path(path, columns, sort, order, short, recursive = false)
def list_path(path, columns, sort, order, short, recursive = false, depth = 0)
# avoid infinite recursion
if depth > 100
return
end
tbl = Rex::Ui::Text::Table.new(
'Header' => "Listing: #{path}",
'SortIndex' => columns.index(sort),
@ -423,7 +429,7 @@ class Console::CommandDispatcher::Stdapi::Fs
child_path = path + ::File::SEPARATOR + fname
end
begin
list_path(child_path, columns, sort, order, short, recursive)
list_path(child_path, columns, sort, order, short, recursive, depth + 1)
rescue RequestError
end
end