diff options
| author | Lars Engels <lme@FreeBSD.org> | 2026-04-25 14:41:24 +0000 |
|---|---|---|
| committer | Lars Engels <lme@FreeBSD.org> | 2026-04-25 14:41:24 +0000 |
| commit | 1566386b90d34dea7f30a0e6b511e178bd0d50b8 (patch) | |
| tree | ea45871127462e5650b3f7fc249ed32868b3f797 | |
| parent | 8f95b8b19088bd8d73f6d14dab7afe848dfc0c35 (diff) | |
bsdinstall: fix root password prompt with backslashes
Use "read -r" to set the root password in "bsdinstall rootpass" to
prevent issues with passwords containing one or more backslash
characters.
PR: 294781
Discussed with: tuexen, crest
Approved by: khorben
MFC after: 3 days
Event: Wiesbaden Hackathon 202604
| -rwxr-xr-x | usr.sbin/bsdinstall/scripts/rootpass | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bsdinstall/scripts/rootpass b/usr.sbin/bsdinstall/scripts/rootpass index 9d25569ae946..5d3a44f4b179 100755 --- a/usr.sbin/bsdinstall/scripts/rootpass +++ b/usr.sbin/bsdinstall/scripts/rootpass @@ -103,8 +103,8 @@ $errormsg" \ exec 5>&- [ $res -eq $BSDDIALOG_OK ] || exit 0 - echo -n "$output" | (read password1 - read password2 + echo -n "$output" | (read -r password1 + read -r password2 [ -n "$password1" -o -n "$password2" ] || exit 62 [ "$password1" = "$password2" ] || exit 63 echo "$password1" | chroot $BSDINSTALL_CHROOT \ |
