[PATCH] login: fix broken login command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 commands/login.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
 
-- 
2.4.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux