[PATCH 2/2] sulogin: make Control-D break out of the main loop

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

 



getpasswd() must return NULL to force breaking out of
the main loop.  Anything else will be treated as a password
to be verified, and will end up with

  Login incorrect

and a repeated password prompt.

(unless the root password happened to be Control-D :)

Signed-off-by: Bjørn Mork <bjorn@xxxxxxx>
---
 login-utils/sulogin.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
index 6a3890e80a16..7fe938150e19 100644
--- a/login-utils/sulogin.c
+++ b/login-utils/sulogin.c
@@ -695,6 +695,7 @@ static char *getpasswd(struct console *con)
 				ptr--;
 			break;
 		case CEOF:
+			ret = (char*)0;
 			goto quit;
 		default:
 			if ((size_t)(ptr - &pass[0]) >= (sizeof(pass) -1 )) {
-- 
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux