Land #7900, missed userpass_file on CredentialCollection.empty?
commit
6522c0df2e
|
@ -207,8 +207,8 @@ class Metasploit::Framework::CredentialCollection
|
|||
|
||||
# Returns true when #each will have no results to iterate
|
||||
def empty?
|
||||
hasUser = username.present? || user_file.present? || !additional_publics.empty?
|
||||
hasPass = password.present? || pass_file.present? || !additional_privates.empty? || blank_passwords
|
||||
hasUser = username.present? || user_file.present? || userpass_file.present? || !additional_publics.empty?
|
||||
hasPass = password.present? || pass_file.present? || userpass_file.present? ||!additional_privates.empty? || blank_passwords
|
||||
prepended_creds.empty? && !hasUser || (hasUser && !hasPass)
|
||||
end
|
||||
|
||||
|
|
|
@ -141,6 +141,15 @@ RSpec.describe Metasploit::Framework::CredentialCollection do
|
|||
end
|
||||
|
||||
describe "#empty?" do
|
||||
context "when only :userpass_file is set" do
|
||||
let(:username) { nil }
|
||||
let(:password) { nil }
|
||||
let(:userpass_file) { "test_file" }
|
||||
specify do
|
||||
expect(collection.empty?).to eq false
|
||||
end
|
||||
end
|
||||
|
||||
context "when :username is set" do
|
||||
context "and :password is set" do
|
||||
specify do
|
||||
|
|
Loading…
Reference in New Issue