Land #11969, deprecate db_rebuild_cache command

This commit is contained in:
Brent Cook 2019-07-11 11:02:17 -05:00
commit 18b8974761
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
2 changed files with 3 additions and 21 deletions

View File

@ -52,7 +52,7 @@ class Db
"db_import" => "Import a scan result file (filetype will be auto-detected)",
"db_export" => "Export a file containing the contents of the database",
"db_nmap" => "Executes nmap and records the output automatically",
"db_rebuild_cache" => "Rebuilds the database-stored module cache",
"db_rebuild_cache" => "Rebuilds the database-stored module cache (deprecated)",
"analyze" => "Analyze database information about a specific address or address range",
}
@ -1889,24 +1889,8 @@ class Db
end
end
def cmd_db_rebuild_cache
unless framework.db.active
print_error("The database is not connected")
return
end
print_status("Purging and rebuilding the module cache in the background...")
framework.threads.spawn("ModuleCacheRebuild", true) do
framework.db.purge_all_module_details
framework.db.update_all_module_details
end
end
def cmd_db_rebuild_cache_help
print_line "Usage: db_rebuild_cache"
print_line
print_line "Purge and rebuild the SQL module cache."
print_line
def cmd_db_rebuild_cache(*args)
print_line "This command is deprecated with Metasploit 5"
end
def cmd_db_save_help

View File

@ -29,8 +29,6 @@ RSpec.describe Msf::Ui::Console::CommandDispatcher::Db do
it { is_expected.to respond_to :cmd_db_nmap }
it { is_expected.to respond_to :cmd_db_notes }
it { is_expected.to respond_to :cmd_db_notes_help }
it { is_expected.to respond_to :cmd_db_rebuild_cache }
it { is_expected.to respond_to :cmd_db_rebuild_cache_help }
it { is_expected.to respond_to :cmd_db_services }
it { is_expected.to respond_to :cmd_db_services_help }
it { is_expected.to respond_to :cmd_db_status }