From bb89ea62a0b7e5c6fcedfe1a28b6dd82236247ce Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 16 Sep 2013 19:49:58 +0200 Subject: login: disable input console if password wrong so we guarantee that barebox is secured again user interaction Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Sascha Hauer --- common/console_simple.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common/console_simple.c') 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 #include #include +#include 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); -- cgit v1.2.3