Blame 0369-ask-password-when-the-user-types-a-overly-long-passw.patch
|
|
4f94566 |
From 64ed5d7dde6c6e127f87606996159d52f641a9f4 Mon Sep 17 00:00:00 2001
|
|
|
4f94566 |
From: Lennart Poettering <lennart@poettering.net>
|
|
|
4f94566 |
Date: Tue, 25 Mar 2014 01:27:05 +0100
|
|
|
4f94566 |
Subject: [PATCH] ask-password: when the user types a overly long password,
|
|
|
4f94566 |
beep and refuse
|
|
|
4f94566 |
MIME-Version: 1.0
|
|
|
4f94566 |
Content-Type: text/plain; charset=UTF-8
|
|
|
4f94566 |
Content-Transfer-Encoding: 8bit
|
|
|
4f94566 |
|
|
|
4f94566 |
Based on a similar patch from David Härdeman.
|
|
|
4f94566 |
|
|
|
4f94566 |
(cherry picked from commit 036eeac5a1799fa2c0ae11a14d8c667b5d303189)
|
|
|
4f94566 |
(cherry picked from commit 643d71530dcadeb94569cc2e5aa057e0df8a7186)
|
|
|
4f94566 |
---
|
|
|
4f94566 |
src/shared/ask-password-api.c | 5 +++++
|
|
|
4f94566 |
1 file changed, 5 insertions(+)
|
|
|
4f94566 |
|
|
|
4f94566 |
diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c
|
|
|
4f94566 |
index 4557155..25367d0 100644
|
|
|
4f94566 |
--- a/src/shared/ask-password-api.c
|
|
|
4f94566 |
+++ b/src/shared/ask-password-api.c
|
|
|
4f94566 |
@@ -207,6 +207,11 @@ int ask_password_tty(
|
|
|
4f94566 |
if (ttyfd >= 0)
|
|
|
4f94566 |
loop_write(ttyfd, "(no echo) ", 10, false);
|
|
|
4f94566 |
} else {
|
|
|
4f94566 |
+ if (p >= sizeof(passphrase)-1) {
|
|
|
4f94566 |
+ loop_write(ttyfd, "\a", 1, false);
|
|
|
4f94566 |
+ continue;
|
|
|
4f94566 |
+ }
|
|
|
4f94566 |
+
|
|
|
4f94566 |
passphrase[p++] = c;
|
|
|
4f94566 |
|
|
|
4f94566 |
if (!silent_mode && ttyfd >= 0)
|