init_module_paths once in msfconsole

MSP-11672

Pass `'DeferModuleLoads' => false` to `Msf::Simple::Framework.create` so
that `framework.modules.init_module_paths` is only called once (directly
in `Msf::Ui::Console::Driver#initialize`) instead of twice (in
`Msf::Simple::Framework.create` and `Msf::Ui::Console::Driver#initialize).
bug/bundler_fix
Luke Imhoff 2014-12-02 10:28:23 -06:00
parent 653c71e029
commit 90c6764426
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
1 changed files with 4 additions and 1 deletions

View File

@ -59,7 +59,10 @@ class Driver < Msf::Ui::Driver
histfile = opts['HistFile'] || Msf::Config.history_file
# Initialize attributes
self.framework = opts['Framework'] || Msf::Simple::Framework.create(opts)
# Defer loading of modules until paths from opts can be added below
framework_create_options = {'DeferModuleLoads' => true}.merge(opts)
self.framework = opts['Framework'] || Msf::Simple::Framework.create(framework_create_options)
if self.framework.datastore['Prompt']
prompt = self.framework.datastore['Prompt']