Use glob instead of entries

Fixes the case where a non-ruby file exists in the login_scanner/
directory
bug/bundler_fix
James Lee 2014-07-08 11:00:33 -05:00
parent d178b1f788
commit 567435f508
No known key found for this signature in database
GPG Key ID: 2D6094C7CEA0A321
1 changed files with 1 additions and 2 deletions

View File

@ -23,8 +23,7 @@ module Metasploit
unless @required unless @required
# Make sure we've required all the scanner classes # Make sure we've required all the scanner classes
dir = File.expand_path("../login_scanner/", __FILE__) dir = File.expand_path("../login_scanner/", __FILE__)
Dir.entries(dir).each do |f| Dir.glob(File.join(dir, "*.rb")).each do |f|
f = File.join(dir, f)
require f if File.file?(f) require f if File.file?(f)
end end
@required = true @required = true