[For-master critical fix PATCH 1/1] login: disable input console if password wrong

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Tue Apr 16 09:10:38 EDT 2013


On 14:41 Tue 16 Apr     , Sascha Hauer wrote:
> On Sun, Apr 14, 2013 at 01:58:24PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > so we garantie that barebox is secured again user interaction
> > 
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> > ---
> >  commands/Kconfig        |    1 +
> >  commands/login.c        |    5 ++++-
> >  common/Kconfig          |    3 +++
> >  common/console.c        |    6 ++++++
> >  common/console_common.c |   15 +++++++++++++++
> >  common/console_simple.c |    7 +++++++
> >  include/console.h       |   12 ++++++++++++
> >  7 files changed, 48 insertions(+), 1 deletion(-)
> > 
> > diff --git a/commands/Kconfig b/commands/Kconfig
> > index c1454c7..d78c925 100644
> > --- a/commands/Kconfig
> > +++ b/commands/Kconfig
> > @@ -87,6 +87,7 @@ config CMD_MENU_MANAGEMENT
> >  config CMD_LOGIN
> >  	tristate
> >  	select PASSWORD
> > +	select CONSOLE_INPUT_RESTRICTION
> 
> I don't think this is worth a kconfig option. Just compile it in
> unconditionally.

ok why not
> 
> > diff --git a/common/console.c b/common/console.c
> > index beb37bd..dcd4d92 100644
> > --- a/common/console.c
> > +++ b/common/console.c
> > @@ -234,6 +234,9 @@ int getc(void)
> >  	unsigned char ch;
> >  	uint64_t start;
> >  
> > +	if (!console_is_input_allow())
> > +		return -EPERM;
> 
> Can we rename this to console_input_allowed()?
don't care

Best Regards,
J.
> 
> Sascha
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list