[18.0][FIX] password_security: treat an absent policy parameter as disabled#953
Open
kwoychesko wants to merge 1 commit into
Open
[18.0][FIX] password_security: treat an absent policy parameter as disabled#953kwoychesko wants to merge 1 commit into
kwoychesko wants to merge 1 commit into
Conversation
The settings page deletes an ir.config_parameter when a value is saved as 0, but _get_all_password_params() fell back to non-zero defaults for a missing parameter -- so setting e.g. Uppercase or Minimum Hours to 0 in the UI silently reverted to the old default and the rule could not be turned off. Default every lookup to 0 so that an absent parameter disables its rule, matching what the settings page already displays. Refs OCA#865.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
res.config.settingsdeletes anir.config_parameterwhen its integer field is saved as0. But_get_all_password_params()falls back to non-zero defaults when a parameter is missing:So setting e.g. Minimum Hours or Uppercase to
0in the UI silently reverts to the old default — the rule can't actually be turned off, even though the settings page then shows0.Fix
Default every lookup to
0, so an absent parameter disables its rule — which is exactly what the settings page already displays. The shipped defaults are still seeded by thepost_inithook, so a fresh install behaves the same; this only changes what a deleted / zeroed parameter means.Adds a regression test.
Refs #865 — this lets an admin actually disable the policy. It deliberately does not change the seeded install defaults; whether
password_securityshould ship with no policy by default is a separate design question.