Remove Msf::DBManager::Sink
MSP-11614 `Msf::DBManager::Sink` contains code for a `sink` that is a meant to serialize database events, but it's unneeded because all database events go directly through ActiveRecord, which handles threading.bug/bundler_fix
parent
8863367cc7
commit
55a8f6f339
|
@ -47,7 +47,6 @@ class Msf::DBManager
|
||||||
autoload :Service, 'msf/core/db_manager/service'
|
autoload :Service, 'msf/core/db_manager/service'
|
||||||
autoload :Session, 'msf/core/db_manager/session'
|
autoload :Session, 'msf/core/db_manager/session'
|
||||||
autoload :SessionEvent, 'msf/core/db_manager/session_event'
|
autoload :SessionEvent, 'msf/core/db_manager/session_event'
|
||||||
autoload :Sink, 'msf/core/db_manager/sink'
|
|
||||||
autoload :Task, 'msf/core/db_manager/task'
|
autoload :Task, 'msf/core/db_manager/task'
|
||||||
autoload :Vuln, 'msf/core/db_manager/vuln'
|
autoload :Vuln, 'msf/core/db_manager/vuln'
|
||||||
autoload :VulnAttempt, 'msf/core/db_manager/vuln_attempt'
|
autoload :VulnAttempt, 'msf/core/db_manager/vuln_attempt'
|
||||||
|
@ -80,7 +79,6 @@ class Msf::DBManager
|
||||||
include Msf::DBManager::Service
|
include Msf::DBManager::Service
|
||||||
include Msf::DBManager::Session
|
include Msf::DBManager::Session
|
||||||
include Msf::DBManager::SessionEvent
|
include Msf::DBManager::SessionEvent
|
||||||
include Msf::DBManager::Sink
|
|
||||||
include Msf::DBManager::Task
|
include Msf::DBManager::Task
|
||||||
include Msf::DBManager::Vuln
|
include Msf::DBManager::Vuln
|
||||||
include Msf::DBManager::VulnAttempt
|
include Msf::DBManager::VulnAttempt
|
||||||
|
@ -160,11 +158,6 @@ class Msf::DBManager
|
||||||
#
|
#
|
||||||
initialize_adapter
|
initialize_adapter
|
||||||
|
|
||||||
#
|
|
||||||
# Instantiate the database sink
|
|
||||||
#
|
|
||||||
initialize_sink
|
|
||||||
|
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
module Msf::DBManager::Sink
|
|
||||||
#
|
|
||||||
# Attributes
|
|
||||||
#
|
|
||||||
|
|
||||||
# Stores a TaskManager for serializing database events
|
|
||||||
attr_accessor :sink
|
|
||||||
|
|
||||||
#
|
|
||||||
# Instance Methods
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# Create a new database sink and initialize it
|
|
||||||
#
|
|
||||||
def initialize_sink
|
|
||||||
self.sink = Msf::TaskManager.new(framework)
|
|
||||||
self.sink.start
|
|
||||||
end
|
|
||||||
|
|
||||||
#
|
|
||||||
# Add a new task to the sink
|
|
||||||
#
|
|
||||||
def queue(proc)
|
|
||||||
self.sink.queue_proc(proc)
|
|
||||||
end
|
|
||||||
|
|
||||||
#
|
|
||||||
# Wait for all pending write to finish
|
|
||||||
#
|
|
||||||
def sync
|
|
||||||
# There is no more queue.
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -40,7 +40,6 @@ describe Msf::DBManager do
|
||||||
it_should_behave_like 'Msf::DBManager::Service'
|
it_should_behave_like 'Msf::DBManager::Service'
|
||||||
it_should_behave_like 'Msf::DBManager::Session'
|
it_should_behave_like 'Msf::DBManager::Session'
|
||||||
it_should_behave_like 'Msf::DBManager::SessionEvent'
|
it_should_behave_like 'Msf::DBManager::SessionEvent'
|
||||||
it_should_behave_like 'Msf::DBManager::Sink'
|
|
||||||
it_should_behave_like 'Msf::DBManager::Task'
|
it_should_behave_like 'Msf::DBManager::Task'
|
||||||
it_should_behave_like 'Msf::DBManager::Vuln'
|
it_should_behave_like 'Msf::DBManager::Vuln'
|
||||||
it_should_behave_like 'Msf::DBManager::VulnAttempt'
|
it_should_behave_like 'Msf::DBManager::VulnAttempt'
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
shared_examples_for 'Msf::DBManager::Sink' do
|
|
||||||
it { is_expected.to respond_to :initialize_sink }
|
|
||||||
it { is_expected.to respond_to :queue }
|
|
||||||
it { is_expected.to respond_to :sink }
|
|
||||||
it { is_expected.to respond_to :sink= }
|
|
||||||
it { is_expected.to respond_to :sync }
|
|
||||||
end
|
|
Loading…
Reference in New Issue