path: root/common/console.c
diff options
authorSascha Hauer <>2015-08-27 15:29:58 +0200
committerSascha Hauer <>2015-08-28 08:00:27 +0200
commit90e766a78fe8ebf8acdc19713e9194266c78c093 (patch)
tree58556b422db0819d335e60c4b5e573206d8c872d /common/console.c
parentf38ba32965c5686c062884fab2e9f505015af82a (diff)
login: rework login mechanism
We used to have the login functionality in the /env/bin/init script. This is hard to review and it's too easy to break the login functionality with changes to this script. Move the places to ask for a password to C code where we have only a few places where we have to ask for a password. Mainly these are run_shell() and the menutree command. This patch introduces a login() function which will only return if the correct password has been entered. Following calls will return immediately without asking for a password again. Signed-off-by: Sascha Hauer <>
Diffstat (limited to 'common/console.c')
1 files changed, 0 insertions, 6 deletions
diff --git a/common/console.c b/common/console.c
index bf64c08..84d4ea7 100644
--- a/common/console.c
+++ b/common/console.c
@@ -344,9 +344,6 @@ int getc(void)
unsigned char ch;
uint64_t start;
- if (unlikely(!console_is_input_allow()))
- return -EPERM;
* For 100us we read the characters from the serial driver
* into a kfifo. This helps us not to lose characters
@@ -381,9 +378,6 @@ EXPORT_SYMBOL(fgetc);
int tstc(void)
- if (unlikely(!console_is_input_allow()))
- return 0;
return kfifo_len(console_input_fifo) || tstc_raw();