aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Henriksson <andreas@fatal.se>2016-11-28 17:24:50 +0100
committerKarel Zak <kzak@redhat.com>2016-12-07 13:32:42 +0100
commit1c4b2d43926e2a7032310cd18b411d8d872cb4ed (patch)
tree2cab61c1cd4a88cd7adcaebd4e0ce043273a9744
parent60dea9d187caa700e42f37c7955116f71be912d5 (diff)
downloadutil-linux-1c4b2d43926e2a7032310cd18b411d8d872cb4ed.tar.gz
sulogin: bail out from getpasswd(...) on timeoutHEADmaster
If timeout happens while waiting in prompt, bail out instead of retrying. Reported-by: Bjørn Mork <bjorn@mork.no> Addresses: http://bugs.debian.org/846107 Signed-off-by: Andreas Henriksson <andreas@fatal.se>
-rw-r--r--login-utils/sulogin.c4
1 files changed, 4 insertions, 0 deletions
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;
}