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

Provide password capacity parameter to set password command #87

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

nathanlcarlson
Copy link
Contributor

Password capacity parameter defaults to 16 if not provided and will result in truncated passwords.

if $real_password.length > 16 and $real_password.length <= 20 {
$password_capacity = '20'
}
if $real_password.length > 20 {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this conditional is evaluated first, the value of $real_password.length would always be <= 20. That would allow one of the conditional statements to be removed. E.g.

  if $real_password.length > 20 {
    fail('ipmi v2 restricts passwords to 20 or fewer characters')
  }
  if $real_password.length <= 16 {
    $password_capacity = '16'
  } else {
    $password_capacity = '20'
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. I also re-ordered such that the unless_command is right next to the place it is used. I've squashed these commits together to tidy this up.

@jhoblitt jhoblitt merged commit 5bf52f8 into jhoblitt:master Sep 24, 2024
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants