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:
Lennart Poettering
2014-04-07 12:19:00 -04:00
committed by Zbigniew Jędrzejewski-Szmek
parent e28c1308c9
commit 643d71530d
+5
View File
@@ -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)