Lands #3943, changes to engine require

bug/bundler_fix
Samuel Huckins 2014-10-03 14:26:50 -05:00
commit f2fc0d88ef
5 changed files with 45 additions and 20 deletions

View File

@ -8,9 +8,9 @@ group :db do
gem 'activerecord', '>= 3.0.0', '< 4.0.0'
# Metasploit::Credential database models
gem 'metasploit-credential', '~> 0.10.1'
gem 'metasploit-credential', '~> 0.12.0'
# Database models shared between framework and Pro.
gem 'metasploit_data_models', '~> 0.20.1'
gem 'metasploit_data_models', '~> 0.21.0'
# Needed for module caching in Mdm::ModuleDetails
gem 'pg', '>= 0.11'
end

View File

@ -7,8 +7,8 @@ PATH
bcrypt
jsobfu (~> 0.2.0)
json
metasploit-concern (~> 0.2.1)
metasploit-model (~> 0.27.1)
metasploit-concern (~> 0.3.0)
metasploit-model (~> 0.28.0)
meterpreter_bins (= 0.0.7)
msgpack
nokogiri
@ -91,32 +91,32 @@ GEM
hike (1.2.3)
i18n (0.6.11)
journey (1.0.4)
jsobfu (0.2.0)
jsobfu (0.2.1)
rkelly-remix (= 0.0.6)
json (1.8.1)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
metasploit-concern (0.2.1)
metasploit-concern (0.3.0)
activesupport (~> 3.0, >= 3.0.0)
railties (< 4.0.0)
metasploit-credential (0.10.1)
metasploit-concern (~> 0.2.1)
metasploit-model (~> 0.27.0)
metasploit_data_models (~> 0.20.0)
metasploit-credential (0.12.0)
metasploit-concern (~> 0.3.0)
metasploit-model (~> 0.28.0)
metasploit_data_models (~> 0.21.0)
pg
railties (< 4.0.0)
rubyntlm
rubyzip (~> 1.1)
metasploit-model (0.27.1)
metasploit-model (0.28.0)
activesupport
railties (< 4.0.0)
metasploit_data_models (0.20.1)
metasploit_data_models (0.21.0)
activerecord (>= 3.2.13, < 4.0.0)
activesupport
arel-helpers
metasploit-concern (~> 0.2.1)
metasploit-model (~> 0.27.0)
metasploit-concern (~> 0.3.0)
metasploit-model (~> 0.28.0)
pg
railties (< 4.0.0)
meterpreter_bins (0.0.7)
@ -218,9 +218,9 @@ DEPENDENCIES
factory_girl (>= 4.1.0)
factory_girl_rails
fivemat (= 1.2.1)
metasploit-credential (~> 0.10.1)
metasploit-credential (~> 0.12.0)
metasploit-framework!
metasploit_data_models (~> 0.20.1)
metasploit_data_models (~> 0.21.0)
network_interface (~> 0.0.1)
pcaprub
pg (>= 0.11)

View File

@ -4,6 +4,14 @@
require 'fileutils'
#
# Metasploit gem engines
#
require 'metasploit/model/engine'
require 'metasploit/concern/engine'
Metasploit::Framework::Require.optionally_require_metasploit_db_gem_engines
# `Rails::Engine` behavior common to both {Metasploit::Framework::Application} and {Metasploit::Framework::Engine}.
module Metasploit::Framework::CommonEngine
extend ActiveSupport::Concern

View File

@ -72,6 +72,23 @@ module Metasploit
end
end
# Tries to require gems necessary for using a database with the framework.
#
# @example
# Metasploit::Framework::Require.optionally_require_metasploit_db_gems
#
# @return [void]
def self.optionally_require_metasploit_db_gem_engines
optionally(
'metasploit/credential/engine',
'metasploit-credential not in the bundle',
)
optionally(
'metasploit_data_models/engine',
'metaspoit_data_models not in the bundle'
)
end
#
# Instance Methods
#

View File

@ -60,10 +60,10 @@ Gem::Specification.new do |spec|
# Needed for some admin modules (scrutinizer_add_user.rb)
spec.add_runtime_dependency 'json'
# Metasploit::Concern hooks
spec.add_runtime_dependency 'metasploit-concern', '~> 0.2.1'
spec.add_runtime_dependency 'metasploit-concern', '~> 0.3.0'
# Things that would normally be part of the database model, but which
# are needed when there's no database
spec.add_runtime_dependency 'metasploit-model', '~> 0.27.1'
spec.add_runtime_dependency 'metasploit-model', '~> 0.28.0'
# Needed for Meterpreter on Windows, soon others.
spec.add_runtime_dependency 'meterpreter_bins', '0.0.7'
# Needed by msfgui and other rpc components