Prevent circular dependency

MSP-10905

Use Metasploit::Framework::Version directly instead of
Msf::Framework to prevent circular dependency when starting msfconsole.
bug/bundler_fix
Luke Imhoff 2014-07-29 14:04:15 -05:00
parent 24a5a155f4
commit 9a5085cbba
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
1 changed files with 3 additions and 4 deletions

View File

@ -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