5113bc
From c19feb058ff5883ab7255241d13732ab66bf44f0 Mon Sep 17 00:00:00 2001
5113bc
From: Andreas Henriksson <andreas@fatal.se>
5113bc
Date: Mon, 28 Nov 2016 17:24:49 +0100
5113bc
Subject: [PATCH 166/173] sulogin: make getpasswd(...) return NULL on ^D
5113bc
MIME-Version: 1.0
5113bc
Content-Type: text/plain; charset=UTF-8
5113bc
Content-Transfer-Encoding: 8bit
5113bc
5113bc
This makes the caller bail out early instead of evaluating the
5113bc
input as a password.
5113bc
5113bc
Reported-by: Bjørn Mork <bjorn@mork.no>
5113bc
Addresses: http://bugs.debian.org/846112
5113bc
Upstream: http://github.com/karelzak/util-linux/commit/60dea9d187caa700e42f37c7955116f71be912d5
5113bc
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=1561200
5113bc
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
5113bc
---
5113bc
 login-utils/sulogin.c | 1 +
5113bc
 1 file changed, 1 insertion(+)
5113bc
5113bc
diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
5113bc
index a6918282e..7ec349953 100644
5113bc
--- a/login-utils/sulogin.c
5113bc
+++ b/login-utils/sulogin.c
5113bc
@@ -661,6 +661,7 @@ static char *getpasswd(struct console *con)
5113bc
 				ptr--;
5113bc
 			break;
5113bc
 		case CEOF:
5113bc
+			ret = NULL;
5113bc
 			goto quit;
5113bc
 		default:
5113bc
 			if ((size_t)(ptr - &pass[0]) >= (sizeof(pass) -1 )) {
5113bc
-- 
5113bc
2.14.4
5113bc