Skip to content

Commit 9a5085c

Browse files
committed
Prevent circular dependency
MSP-10905 Use Metasploit::Framework::Version directly instead of Msf::Framework to prevent circular dependency when starting msfconsole.
1 parent 24a5a15 commit 9a5085c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/msf/base/config.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# Project
1111
#
1212

13-
require 'msf/core'
1413
require 'rex/compat'
1514

1615
module Msf
@@ -37,16 +36,16 @@ def self.get_config_root
3736
['HOME', 'LOCALAPPDATA', 'APPDATA', 'USERPROFILE'].each do |dir|
3837
val = Rex::Compat.getenv(dir)
3938
if (val and File.directory?(val))
40-
return File.join(val, ".msf#{Msf::Framework::Major}")
39+
return File.join(val, ".msf#{Metasploit::Framework::Version::MAJOR}")
4140
end
4241
end
4342

4443
begin
4544
# First we try $HOME/.msfx
46-
File.expand_path("~#{FileSep}.msf#{Msf::Framework::Major}")
45+
File.expand_path("~#{FileSep}.msf#{Metasploit::Framework::Version::MAJOR}")
4746
rescue ::ArgumentError
4847
# Give up and install root + ".msfx"
49-
InstallRoot + ".msf#{Msf::Framework::Major}"
48+
InstallRoot + ".msf#{Metasploit::Framework::Version::MAJOR}"
5049
end
5150
end
5251

0 commit comments

Comments
 (0)