Prevent circular dependency
MSP-10905 Use Metasploit::Framework::Version directly instead of Msf::Framework to prevent circular dependency when starting msfconsole.bug/bundler_fix
parent
24a5a155f4
commit
9a5085cbba
|
@ -10,7 +10,6 @@ require 'fileutils'
|
|||
# Project
|
||||
#
|
||||
|
||||
require 'msf/core'
|
||||
require 'rex/compat'
|
||||
|
||||
module Msf
|
||||
|
@ -37,16 +36,16 @@ class Config < Hash
|
|||
['HOME', 'LOCALAPPDATA', 'APPDATA', 'USERPROFILE'].each do |dir|
|
||||
val = Rex::Compat.getenv(dir)
|
||||
if (val and File.directory?(val))
|
||||
return File.join(val, ".msf#{Msf::Framework::Major}")
|
||||
return File.join(val, ".msf#{Metasploit::Framework::Version::MAJOR}")
|
||||
end
|
||||
end
|
||||
|
||||
begin
|
||||
# First we try $HOME/.msfx
|
||||
File.expand_path("~#{FileSep}.msf#{Msf::Framework::Major}")
|
||||
File.expand_path("~#{FileSep}.msf#{Metasploit::Framework::Version::MAJOR}")
|
||||
rescue ::ArgumentError
|
||||
# Give up and install root + ".msfx"
|
||||
InstallRoot + ".msf#{Msf::Framework::Major}"
|
||||
InstallRoot + ".msf#{Metasploit::Framework::Version::MAJOR}"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue