From 30b914e4f065b621dbfcacb93cfff657e0ee07c0 Mon Sep 17 00:00:00 2001 From: asoto-r7 Date: Thu, 20 Dec 2018 12:07:35 -0600 Subject: [PATCH] msfdb: Added verbosity to 'missing requirements' error --- msfdb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/msfdb b/msfdb index 9fe663cd89..14bf3994c8 100755 --- a/msfdb +++ b/msfdb @@ -921,16 +921,17 @@ def has_requirements ret_val = true postgresql_cmds = %w(psql pg_ctl initdb createdb) other_cmds = %w(bundle thin) - missing_msg = 'Missing requirement: %s does not appear to be installed or is not in the environment path' + missing_msg = "Missing requirement: %s does not appear to be installed or '%s' is not in the environment path" - unless postgresql_cmds.all? { |cmd| !Msf::Util::Helper.which(cmd).nil? } - puts missing_msg % { name: 'PostgreSQL' } + postgresql_cmds.each do |cmd| + next if Msf::Util::Helper.which(cmd) + puts missing_msg % { name: 'PostgreSQL', prog: cmd } ret_val = false end other_cmds.each do |cmd| if Msf::Util::Helper.which(cmd).nil? - puts missing_msg % { name: "'#{cmd}'" } + puts missing_msg % { name: "'#{cmd}'", prog: cmd } ret_val = false end end