aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Henriksson <andreas@fatal.se>2016-11-28 17:24:49 +0100
committerKarel Zak <kzak@redhat.com>2016-12-07 13:32:42 +0100
commit60dea9d187caa700e42f37c7955116f71be912d5 (patch)
tree9fad920a7d089adc623a5ea5d1a910a07faef6ed
parent809869ca8c3d5d548adac9648dbcea2f641a878b (diff)
downloadutil-linux-60dea9d187caa700e42f37c7955116f71be912d5.tar.gz
sulogin: make getpasswd(...) return NULL on ^D
This makes the caller bail out early instead of evaluating the input as a password. Reported-by: Bjørn Mork <bjorn@mork.no> Addresses: http://bugs.debian.org/846112 Signed-off-by: Andreas Henriksson <andreas@fatal.se>
-rw-r--r--login-utils/sulogin.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
index a44216bda0..806a967f05 100644
--- a/login-utils/sulogin.c
+++ b/login-utils/sulogin.c
@@ -695,6 +695,7 @@ static char *getpasswd(struct console *con)
ptr--;
break;
case CEOF:
+ ret = NULL;
goto quit;
default:
if ((size_t)(ptr - &pass[0]) >= (sizeof(pass) -1 )) {