]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sulogin: make getpasswd(...) return NULL on ^D
authorAndreas Henriksson <andreas@fatal.se>
Mon, 28 Nov 2016 16:24:49 +0000 (17:24 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 7 Dec 2016 12:32:42 +0000 (13:32 +0100)
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>
login-utils/sulogin.c

index a44216bda091d9ce8731ff0a90a1793592bbca89..806a967f0535039c255f4be5d2c5048231b91d8c 100644 (file)
@@ -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 )) {