summaryrefslogtreecommitdiffstats
path: root/commands/login.c
diff options
context:
space:
mode:
authorHubert Feurstein <h.feurstein@gmail.com>2015-06-17 15:02:53 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-06-18 09:44:37 +0200
commitcd09bf8f515c014fcceffaf2aeb8ed434dd527f2 (patch)
tree857c9145a0eff28f6398b97fb13d9a7c20f2e6b6 /commands/login.c
parent0542ec647ee146d2e81605396cba8b365a9e2710 (diff)
downloadbarebox-cd09bf8f515c014fcceffaf2aeb8ed434dd527f2.tar.gz
login: fix broken login command
It was possible to login with ctrl-c or an empty password. This bug was introduced by the recent digest changes in common/password.c (e49a47fb). The function check_passwd returns now also negative error codes which were not correctly handled in do_login. Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/login.c')
-rw-r--r--commands/login.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/login.c b/commands/login.c
index 210eb20..bf5085c 100644
--- a/commands/login.c
+++ b/commands/login.c
@@ -71,7 +71,7 @@ static int do_login(int argc, char *argv[])
run_command(timeout_cmd);
}
- if (check_passwd(passwd, passwd_len))
+ if (check_passwd(passwd, passwd_len) == 1)
return 0;
} while(1);