Skip to content

Commit

Permalink
Land #11393, If an option alias is deregistered, also deregister the …
Browse files Browse the repository at this point in the history
…original option
  • Loading branch information
busterb authored and msjenkins-r7 committed Feb 20, 2019
1 parent b56b28a commit 6f177d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions lib/msf/core/data_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,6 @@ def each(&block)
list.each(&block)
end

protected

#
# Case-insensitive key lookup
#
Expand Down
8 changes: 6 additions & 2 deletions lib/msf/core/module/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ def validate
#
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

Expand Down Expand Up @@ -62,4 +66,4 @@ def register_options(options, owner = self.class)
self.datastore.import_options(self.options, 'self', true)
import_defaults(false)
end
end
end

0 comments on commit 6f177d8

Please sign in to comment.