Simplify logic
parent
5985f37fe8
commit
a2c7ebc2b1
|
@ -888,12 +888,12 @@ class Db
|
|||
query.find_each do |core|
|
||||
|
||||
# Exclude non-blank username creds if that's what we're after
|
||||
if user && user.empty? && !(core.public && core.public.username.blank?)
|
||||
if user == "" && !(core.public && core.public.username.blank?)
|
||||
next
|
||||
end
|
||||
|
||||
# Exclude non-blank password creds if that's what we're after
|
||||
if pass && pass.empty? && !(core.private && core.private.data.blank?)
|
||||
if pass == "" && !(core.private && core.private.data.blank?)
|
||||
next
|
||||
end
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ describe Msf::Ui::Console::CommandDispatcher::Db do
|
|||
|
||||
context "and when the username is blank" do
|
||||
it "should show a user that matches the given expression" do
|
||||
db.cmd_creds("-u", blank_username )
|
||||
db.cmd_creds("-u", blank_username)
|
||||
@output.should =~ [
|
||||
"Credentials",
|
||||
"===========",
|
||||
|
@ -158,7 +158,7 @@ describe Msf::Ui::Console::CommandDispatcher::Db do
|
|||
end
|
||||
context "and when the password is blank" do
|
||||
it "should show a user that matches the given expression" do
|
||||
db.cmd_creds("-P", blank_password )
|
||||
db.cmd_creds("-P", blank_password)
|
||||
@output.should =~ [
|
||||
"Credentials",
|
||||
"===========",
|
||||
|
|
Loading…
Reference in New Issue