Skip to content

Commit

Permalink
msfenv compatibility with Pro
Browse files Browse the repository at this point in the history
MSP-9653

lib/msfenv.rb should only load the framework environment to initialize
Metasploit::Framework::Application if a Rails.application is not
defined, otherwise it will clash with the Rails application in prosvc.
  • Loading branch information
limhoff-r7 committed Jun 2, 2014
1 parent 1055efb commit b436aef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/msfenv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@
root = Pathname.new(__FILE__).expand_path.parent.parent
config = root.join('config')
require config.join('boot')
require config.join('environment')

# Requiring environment will define the Metasploit::Framework::Application as the one and only Rails::Application in
# this process and cause an error if a Rails.application is already defined, such as when loading msfenv through
# msfconsole in Metasploit Pro.
unless defined?(Rails) && !Rails.application.nil?
require config.join('environment')
end

0 comments on commit b436aef

Please sign in to comment.