ad9577
From 971b2ecede4d2040e879d9cfb56332a2e210bed8 Mon Sep 17 00:00:00 2001
ad9577
From: Andreas Henriksson <andreas@fatal.se>
ad9577
Date: Mon, 28 Nov 2016 17:24:50 +0100
ad9577
Subject: [PATCH 167/173] sulogin: bail out from getpasswd(...) on timeout
ad9577
MIME-Version: 1.0
ad9577
Content-Type: text/plain; charset=UTF-8
ad9577
Content-Transfer-Encoding: 8bit
ad9577
ad9577
If timeout happens while waiting in prompt, bail out instead
ad9577
of retrying.
ad9577
ad9577
Reported-by: Bjørn Mork <bjorn@mork.no>
ad9577
Addresses: http://bugs.debian.org/846107
ad9577
Upstream: http://github.com/karelzak/util-linux/commit/1c4b2d43926e2a7032310cd18b411d8d872cb4ed
ad9577
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=1561200
ad9577
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
ad9577
---
ad9577
 login-utils/sulogin.c | 4 ++++
ad9577
 1 file changed, 4 insertions(+)
ad9577
ad9577
diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
ad9577
index 7ec349953..dd73a1c50 100644
ad9577
--- a/login-utils/sulogin.c
ad9577
+++ b/login-utils/sulogin.c
ad9577
@@ -611,6 +611,10 @@ static char *getpasswd(struct console *con)
ad9577
 	while (cp->eol == '\0') {
ad9577
 		if (read(fd, &c, 1) < 1) {
ad9577
 			if (errno == EINTR || errno == EAGAIN) {
ad9577
+				if (alarm_rised) {
ad9577
+					ret = NULL;
ad9577
+					goto quit;
ad9577
+				}
ad9577
 				usleep(1000);
ad9577
 				continue;
ad9577
 			}
ad9577
-- 
ad9577
2.14.4
ad9577