mirror of
https://github.com/systemd/systemd.git
synced 2025-01-26 14:04:03 +03:00
ask-password: when the user types a overly long password, beep and refuse
Based on a similar patch from David Härdeman.
This commit is contained in:
parent
af7424af70
commit
036eeac5a1
Notes:
Lennart Poettering
2014-03-25 04:09:46 +01:00
Backport: bugfix
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user