diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2020-04-05 19:25:46 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2020-04-05 19:25:46 +0000 |
commit | d9dc1bbb352b30f9322b33dcf3327a63a31d138c (patch) | |
tree | cd188431e3541578a7b1dd8bac362a9aaf7e919f | |
parent | 3920ec2f846f7ebb004929a0bccbef481f867f11 (diff) | |
download | pw-darwin-d9dc1bbb352b30f9322b33dcf3327a63a31d138c.tar.gz pw-darwin-d9dc1bbb352b30f9322b33dcf3327a63a31d138c.tar.zst pw-darwin-d9dc1bbb352b30f9322b33dcf3327a63a31d138c.zip |
adduser: allow standard IFS characters in passwords
Notably, the default IFS contains space/tab, thus any leading/trailing
whitespace characters tend to be removed.
Set IFS= for just the read lines to mitigate this, allowing the user to be
less surprised when their leading/trailing spaces weren't actually captured
in the password as they are with other means of setting a user's password.
PR: 245342
Submitted by: dereks_lifeofadishwasher.com
Reviewed by: jilles
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24292
-rw-r--r-- | adduser/adduser.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/adduser/adduser.sh b/adduser/adduser.sh index 5f80d77..91a1b4b 100644 --- a/adduser/adduser.sh +++ b/adduser/adduser.sh @@ -733,10 +733,10 @@ input_interactive() { trap 'stty echo; exit' 0 1 2 3 15 stty -echo echo -n "Enter password: " - read -r upass + IFS= read -r upass echo'' echo -n "Enter password again: " - read -r _passconfirm + IFS= read -r _passconfirm echo '' stty echo # if user entered a blank password |