From bbb24d90af4069fd52f7525fbb8dc209b61a05e8 Mon Sep 17 00:00:00 2001 From: Andreas Henriksson Date: Mon, 28 Nov 2016 17:24:50 +0100 Subject: [PATCH] sulogin: bail out from getpasswd(...) on timeout MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If timeout happens while waiting in prompt, bail out instead of retrying. Reported-by: Bjørn Mork Addresses: http://bugs.debian.org/846107 Signed-off-by: Andreas Henriksson --- login-utils/sulogin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c index 43117b2b46..79a9274222 100644 --- a/login-utils/sulogin.c +++ b/login-utils/sulogin.c @@ -645,6 +645,10 @@ static char *getpasswd(struct console *con) while (cp->eol == '\0') { if (read(fd, &c, 1) < 1) { if (errno == EINTR || errno == EAGAIN) { + if (alarm_rised) { + ret = NULL; + goto quit; + } xusleep(250000); continue; } -- 2.47.2