Improve error logging when modules fail to load.
* Don't print module file path twice on the same line * Use print_error instead of print * Remove unnecessary newlines git-svn-id: file:///home/svn/framework3/trunk@9358 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
a6d39ca581
commit
d90656be0e
|
@ -932,8 +932,7 @@ protected
|
|||
return false
|
||||
end
|
||||
end
|
||||
|
||||
errmsg = "#{file}: #{e.class} #{e}"
|
||||
errmsg = "#{e.class} #{e}"
|
||||
self.module_failed[file] = errmsg
|
||||
elog(errmsg)
|
||||
return false
|
||||
|
|
|
@ -71,7 +71,7 @@ class Auxiliary
|
|||
omod = self.mod
|
||||
self.mod = framework.modules.reload_module(mod)
|
||||
if(not self.mod)
|
||||
print_status("Failed to reload module: #{framework.modules.failed[omod.file_path]}")
|
||||
print_error("Failed to reload module: #{framework.modules.failed[omod.file_path]}")
|
||||
self.mod = omod
|
||||
end
|
||||
rescue
|
||||
|
@ -87,7 +87,7 @@ class Auxiliary
|
|||
omod = self.mod
|
||||
self.mod = framework.modules.reload_module(mod)
|
||||
if(not self.mod)
|
||||
print_status("Failed to reload module: #{framework.modules.failed[omod.file_path]}")
|
||||
print_error("Failed to reload module: #{framework.modules.failed[omod.file_path]}")
|
||||
self.mod = omod
|
||||
return
|
||||
end
|
||||
|
|
|
@ -284,11 +284,10 @@ class Driver < Msf::Ui::Driver
|
|||
def on_startup
|
||||
# Check for modules that failed to load
|
||||
if (framework.modules.failed.length > 0)
|
||||
print("[*] WARNING! The following modules could not be loaded!\n\n")
|
||||
print_error("WARNING! The following modules could not be loaded!")
|
||||
framework.modules.failed.each_pair do |file, err|
|
||||
print("\t#{file}: #{err}\n\n")
|
||||
print_error("\t#{file}: #{err}")
|
||||
end
|
||||
print("\n")
|
||||
end
|
||||
framework.events.on_ui_start(Msf::Framework::Revision)
|
||||
|
||||
|
|
Loading…
Reference in New Issue