From 567435f5085cfa7e54804f1eca7504f66d271c75 Mon Sep 17 00:00:00 2001 From: James Lee Date: Tue, 8 Jul 2014 11:00:33 -0500 Subject: [PATCH] Use glob instead of entries Fixes the case where a non-ruby file exists in the login_scanner/ directory --- lib/metasploit/framework/login_scanner.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/metasploit/framework/login_scanner.rb b/lib/metasploit/framework/login_scanner.rb index ed8f5076dd..1730977b7a 100644 --- a/lib/metasploit/framework/login_scanner.rb +++ b/lib/metasploit/framework/login_scanner.rb @@ -23,8 +23,7 @@ module Metasploit unless @required # Make sure we've required all the scanner classes dir = File.expand_path("../login_scanner/", __FILE__) - Dir.entries(dir).each do |f| - f = File.join(dir, f) + Dir.glob(File.join(dir, "*.rb")).each do |f| require f if File.file?(f) end @required = true