Land #11393, If an option alias is deregistered, also deregister the original option

4.x
Brent Cook 2019-02-19 20:57:23 -06:00 committed by Metasploit
parent b56b28a43f
commit 6f177d891a
No known key found for this signature in database
GPG Key ID: CDFB5FA52007B954
2 changed files with 6 additions and 4 deletions

View File

@ -306,8 +306,6 @@ class DataStore < Hash
list.each(&block)
end
protected
#
# Case-insensitive key lookup
#

View File

@ -29,8 +29,12 @@ module Msf::Module::Options
#
def deregister_options(*names)
names.each { |name|
self.options.remove_option(name)
real_name = self.datastore.find_key_case(name)
self.datastore.delete(name)
self.options.remove_option(name)
if real_name != name
self.options.remove_option(real_name)
end
}
end
@ -62,4 +66,4 @@ module Msf::Module::Options
self.datastore.import_options(self.options, 'self', true)
import_defaults(false)
end
end
end