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
Add ability to set a password hash for a user. Undef = !. #18
Conversation
I'm curious about the reason for assuming a locked password ('!') for users who have no $password parameter defined. Why not just let the $password be some value or default undef? Locked passwords could still be achieved by passing '!' as the $password value. |
That would probably be a better approach. I will update the branch with that modification. The idea was that if we were managing the account we would want to make sure it either had a known password (or be locked); but not be in a state where we didn't know if it actually had a password set or not. The preference in our scenario would be to encourage the use of ssh keys. I'll update so that locking the password is optional as you suggested this afternoon. |
I actually was about to make a PR of my own that incorporates the changes discussed in this thread: Besides the ability to specify a password hash (or leave it undef), I'm also needing the ability to provide relationship metaparameters, i.e. unless, before, require. |
08c9489
to
c284290
Compare
I fixed a validation problem with "!" that was pointed out; used single quotes instead. I also added a second commit that changes the behavior of assuming an undefined password will disable password login with '!' in place of the hash. It now just leaves the password alone if $password is undef. Please let me know if you'd prefer these to be squashed to 1 commit. |
I withdraw any previous requests made in this thread. Had to switch to another module. |
groups => $groups, | ||
home => $_home, | ||
managehome => true, | ||
membership => $groups_membership, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you can just add password => $password
here and don't do the if $password != undef ... else ... end
block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that does make sense to remove now. Doing that now.
…revious behaviour was to assume disabling password login with '!'.
LGTM |
Add ability to set a password hash for a user. Undef = !.
I had a use case where I needed to set a password hash for some accounts.