sulogin: make getpasswd(...) return NULL on ^D
PATCH 1/1 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 <[email protected]>
Addresses: http://bugs.debian.org/846112
Signed-off-by Andreas Henriksson <[email protected]>
--- login-utils/sulogin.c | 1 + 1 file changed, 1 insertion(+)
login-utils/sulogin.c +1 -0
@@ -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 )) {
Signature · 1 line
2.10.2
PATCH 1/1 sulogin: bail out from getpasswd(...) on timeout
If timeout happens while waiting in prompt, bail out instead of retrying.
Reported-by Bjørn Mork <[email protected]>
Addresses: http://bugs.debian.org/846107
Signed-off-by Andreas Henriksson <[email protected]>
--- login-utils/sulogin.c | 4 ++++ 1 file changed, 4 insertions(+)
login-utils/sulogin.c +4 -0
@@ -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 ; }
Signature · 1 line
2.10.2
Karel Zak
maintainerQuoted 3 lines · Andreas Henriksson
Reported-by Bjørn Mork <[email protected]>Addresses: http://bugs.debian.org/846112
Signed-off-by Andreas Henriksson <[email protected]>
Applied (both patches), thanks!
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com