Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unregister aliases when a datastore option is unregistered #10998

Merged
merged 3 commits into from
Nov 21, 2018

Conversation

busterb
Copy link
Member

@busterb busterb commented Nov 21, 2018

Per #10981 (comment) if you unregister a datastore option with an alias, the alias would continue existing after the original option, causing it to continue receiving assignment values. The alias would continue overshadowing any directly-registered options as well.

This fixes 'delete' in the datastore class so it removes aliases for the deleted option. It also modifies find_key_case to require that an alias key actually exist before returning it (belt-and-suspenders), and observes that the linear scan of all keys was pointless in the non-alias case, since we fall through to returning the key anyway on no match.

Verification Steps

@acammack-r7 acammack-r7 self-assigned this Nov 21, 2018
@acammack-r7 acammack-r7 merged commit 7312fa7 into rapid7:master Nov 21, 2018
@acammack-r7
Copy link
Contributor

acammack-r7 commented Nov 21, 2018

Release Notes

When unregistering options for a module, aliases are now also unregistered. To avoid option name conflicts, the list of available options is now checked before the list of aliases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug library rn-fix release notes fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants