msfdb: Added verbosity to 'missing requirements' error

GSoC/Meterpreter_Web_Console
asoto-r7 2018-12-20 12:07:35 -06:00
parent 6204d0595e
commit 30b914e4f0
No known key found for this signature in database
GPG Key ID: F531810B7FE55396
1 changed files with 5 additions and 4 deletions

9
msfdb
View File

@ -921,16 +921,17 @@ def has_requirements
ret_val = true ret_val = true
postgresql_cmds = %w(psql pg_ctl initdb createdb) postgresql_cmds = %w(psql pg_ctl initdb createdb)
other_cmds = %w(bundle thin) other_cmds = %w(bundle thin)
missing_msg = 'Missing requirement: %<name>s does not appear to be installed or is not in the environment path' missing_msg = "Missing requirement: %<name>s does not appear to be installed or '%<prog>s' is not in the environment path"
unless postgresql_cmds.all? { |cmd| !Msf::Util::Helper.which(cmd).nil? } postgresql_cmds.each do |cmd|
puts missing_msg % { name: 'PostgreSQL' } next if Msf::Util::Helper.which(cmd)
puts missing_msg % { name: 'PostgreSQL', prog: cmd }
ret_val = false ret_val = false
end end
other_cmds.each do |cmd| other_cmds.each do |cmd|
if Msf::Util::Helper.which(cmd).nil? if Msf::Util::Helper.which(cmd).nil?
puts missing_msg % { name: "'#{cmd}'" } puts missing_msg % { name: "'#{cmd}'", prog: cmd }
ret_val = false ret_val = false
end end
end end