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

GSoC/Meterpreter_Web_Console
Brent Cook 2019-02-19 20:57:23 -06:00
commit d2775c02f8
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
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