chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
af7424a
)
ask-password: when the user types a overly long password, beep and refuse
author
Lennart Poettering
<lennart@poettering.net>
Tue, 25 Mar 2014 00:27:05 +0000
(
01:27
+0100)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 25 Mar 2014 00:27:45 +0000
(
01:27
+0100)
Based on a similar patch from David Härdeman.
src/shared/ask-password-api.c
patch
|
blob
|
history
diff --git
a/src/shared/ask-password-api.c
b/src/shared/ask-password-api.c
index 117f0c668747c15669154e2b4a764c69a124e8d3..96f16cc7f8358eb2a25835a687f66f20a3409d58 100644
(file)
--- a/
src/shared/ask-password-api.c
+++ b/
src/shared/ask-password-api.c
@@
-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)