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

Projects
None yet
3 participants
@busterb
Contributor

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

  • modify the module referenced in #10981 and deregister the 'RHOSTS' option
  • verify that you can still set 'rhost' and 'RHOST' and the actual datastore option is updated

busterb added some commits Nov 21, 2018

delete option aliases when an option is deleted
Otherwise the aliases will remain active and if the aliased value is redefined

@acammack-r7 acammack-r7 self-assigned this Nov 21, 2018

@acammack-r7 acammack-r7 merged commit 7312fa7 into rapid7:master Nov 21, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

acammack-r7 added a commit that referenced this pull request Nov 21, 2018

msjenkins-r7 added a commit that referenced this pull request Nov 21, 2018

@acammack-r7

This comment has been minimized.

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