Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH] sulogin: make getpasswd(...) return NULL on ^D
@ 2016-11-28 16:24 Andreas Henriksson
  2016-11-28 16:24 ` [PATCH] sulogin: bail out from getpasswd(...) on timeout Andreas Henriksson
  2016-12-07 12:34 ` [PATCH] sulogin: make getpasswd(...) return NULL on ^D Karel Zak
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Henriksson @ 2016-11-28 16:24 UTC (permalink / raw)
  To: util-linux; +Cc: Andreas Henriksson

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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
index 1c4313a..43117b2 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 )) {
-- 
2.10.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-07 12:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-28 16:24 [PATCH] sulogin: make getpasswd(...) return NULL on ^D Andreas Henriksson
2016-11-28 16:24 ` [PATCH] sulogin: bail out from getpasswd(...) on timeout Andreas Henriksson
2016-12-07 12:34 ` [PATCH] sulogin: make getpasswd(...) return NULL on ^D Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox