diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2013-09-16 19:49:58 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-09-19 08:49:47 +0200 |
commit | bb89ea62a0b7e5c6fcedfe1a28b6dd82236247ce (patch) | |
tree | 45448d5807a24e8bd1b42e27994334e590763f2f /common/console_simple.c | |
parent | 54385ace4b98f8131d53757d18858d0729960dc2 (diff) | |
download | barebox-bb89ea62a0b7e5c6fcedfe1a28b6dd82236247ce.tar.gz barebox-bb89ea62a0b7e5c6fcedfe1a28b6dd82236247ce.tar.xz |
login: disable input console if password wrong
so we guarantee that barebox is secured again user interaction
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/console_simple.c')
-rw-r--r-- | common/console_simple.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/console_simple.c b/common/console_simple.c index 101064b69a..5c80dcdf1e 100644 --- a/common/console_simple.c +++ b/common/console_simple.c @@ -3,6 +3,7 @@ #include <fs.h> #include <errno.h> #include <debug_ll.h> +#include <console.h> LIST_HEAD(console_list); EXPORT_SYMBOL(console_list); @@ -40,6 +41,9 @@ EXPORT_SYMBOL(console_putc); int tstc(void) { + if (unlikely(!console_is_input_allow())) + return 0; + if (!console) return 0; @@ -49,6 +53,9 @@ EXPORT_SYMBOL(tstc); int getc(void) { + if (unlikely(!console_is_input_allow())) + return -EPERM; + if (!console) return -EINVAL; return console->getc(console); |