File util-linux-agetty-smart-reload-13.patch of Package util-linux.25288

Refresh.
From 5de9751997cf490088f62f41fd92be57cf7ceea4 Mon Sep 17 00:00:00 2001
From: Stanislav Brabec <sbrabec@suse.cz>
Date: Wed, 27 Feb 2019 23:22:19 +0100
Subject: [PATCH 13/14] agetty: Fix input of non-ASCII characters in
 get_logname()

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@suse.cz>
Cc: Lubomir Rintel <lkundrak@v3.sk>
Tested-by: Lubomir Rintel <lkundrak@v3.sk>
---
 term-utils/agetty.c | 2 --
 1 file changed, 2 deletions(-)

Index: util-linux-2.31.1/term-utils/agetty.c
===================================================================
--- util-linux-2.31.1.orig/term-utils/agetty.c
+++ util-linux-2.31.1/term-utils/agetty.c
@@ -2026,8 +2026,6 @@ static char *get_logname(struct issue *i
 			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)
openSUSE Build Service is sponsored by