From: Andreas Henriksson Date: Mon, 28 Nov 2016 16:24:50 +0000 (+0100) Subject: sulogin: bail out from getpasswd(...) on timeout X-Git-Tag: v2.30-rc1~361 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c4b2d43926e2a7032310cd18b411d8d872cb4ed;p=thirdparty%2Futil-linux.git sulogin: bail out from getpasswd(...) on timeout 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 --- diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c index 806a967f05..8dc2b639d3 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; }