Skip to content

Commit

Permalink
agetty: Fix input of non-ASCII characters in get_logname()
Browse files Browse the repository at this point in the history
As login supports non-ASCII characters in the logname, agetty should be
consistent.

8b58ffd re-activated old and ASCII-only get_logname(), which restricted
the input to ASCII only. As the code does not read whole characters,
isascii(ascval) and isprint(ascval) returns nonsenses after entering a
non-ASCII character.

As keyboard maps don't contain unprintable non-control characters, it
seems to be relatively safe to remove both checks.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Cc: Lubomir Rintel <lkundrak@v3.sk>
Tested-by: Lubomir Rintel <lkundrak@v3.sk>
  • Loading branch information
stanislav-brabec authored and karelzak committed Mar 4, 2019
1 parent 09fc947 commit 5de9751
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions term-utils/agetty.c
Original file line number Diff line number Diff line change
Expand Up @@ -2175,8 +2175,6 @@ static char *get_logname(struct issue *ie, struct options *op, struct termios *t
case CTL('D'):
exit(EXIT_SUCCESS);
default:
if (!isascii(ascval) || !isprint(ascval))
break;
if ((size_t)(bp - logname) >= sizeof(logname) - 1)
log_err(_("%s: input overrun"), op->tty);
if ((tp->c_lflag & ECHO) == 0)
Expand Down

0 comments on commit 5de9751

Please sign in to comment.