feat: Add password confirmation#4072
Conversation
More strict handling of the password parameter. After `shift`, `$*` considers not only the first parameter, but all as password. `setup email add [email protected] top secret` makes "topsecret" the password, which is weird.
|
@georglauterbach @polarathene If you agree, I'll change this logic in the other files as well. |
I cannot recall, the scripts for all of these features was inconsistent and messy (Not that the unified approach I refactored is any more pleasant to work with). It was probably a naive approach. If someone wants spaces they should quote wrap, no clue why we'd take in additional parameters, I think some utilities did have sanity checks on parameter length. This is really something that'd be much nicer in Rust or similar instead of the assortment of shell scripts and awkward syntax required for some of the logic which is not as nice to maintain. If there was a reason for it that isn't obvious and we break something by removing the shift logic, then we revert and add test cases 😅 I assume the shift was used for the convenience of passing remaining params to a function call with
|
|
|
||
| # Also used by addsaslpassword | ||
| function _password_request_if_missing() { | ||
| local CONFIRM |
There was a problem hiding this comment.
Perhaps PASSWD_CONFIRM or similar would be a bit better in context. I'm not fussed either way though.
|
I don't know either why we use |
e7fd385
Description
Fixes: #4071 (typo when entering the password)
Type of change
Checklist
docs/)CHANGELOG.md