[PATCH 1/2] agetty: Fix input of non-ASCII characters in get_logname()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As login supports non-ASCII characters in the logname, agetty should be
consistent.

8b58ffdd 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@xxxxxxx>
Cc: Lubomir Rintel <lkundrak@xxxxx>
---
 term-utils/agetty.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 1a3ebc308..0ef8ba36d 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -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)
-- 
2.20.1

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                         e-mail: sbrabec@xxxxxxxx
Křižíkova 148/34 (Corso IIa)                    tel: +420 284 084 060
186 00 Praha 8-Karlín                          fax:  +420 284 084 001
Czech Republic                                    http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux