mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-07 06:03:51 +00:00
ask-password: when the user types a overly long password, beep and refuse
Based on a similar patch from David Härdeman.
(cherry picked from commit 036eeac5a1)
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
e28c1308c9
commit
643d71530d
@@ -207,6 +207,11 @@ int ask_password_tty(
|
||||
if (ttyfd >= 0)
|
||||
loop_write(ttyfd, "(no echo) ", 10, false);
|
||||
} else {
|
||||
if (p >= sizeof(passphrase)-1) {
|
||||
loop_write(ttyfd, "\a", 1, false);
|
||||
continue;
|
||||
}
|
||||
|
||||
passphrase[p++] = c;
|
||||
|
||||
if (!silent_mode && ttyfd >= 0)
|
||||
|
||||
Reference in New Issue
Block a user