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:
Lennart Poettering
2014-03-25 01:27:45 +01:00
parent af7424af70
commit 036eeac5a1
+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)