27 вересня 2005 о 07:38 +0200 Christian Perrier написав(-ла): > I was waiting for upstream resync to deal with this bug report but it > still seems to be here. > > When entering high-ascii characters at the login prompt (usually by > mistake), such as "é", and then hitting Backspace to remove them, > they're not erased at the prompt...and, when entering the correct > login and validating, login switched the terminal to all-caps. You can switch terminal to all-caps more easyly: just enter you login in all-caps and then password as usual. So, I think it (all-caps) is normal behavior (for historic reasons probably).
> > This happens in the Linux console. Nothing bad happens in a terminal, > eitheer UTF-8 or ISO.... Because terminal you have used do not support all-caps mode ;) I tried to look at problem with erasing of characters and found that kernel uses undocumented (in termios(3)) flag IUTF8. If this flag is not set kernel tty driver will interpret characters as single-byte. So some program should set this flag when terminal is in UTF8 mode... Attached patch fixes this problem for 'login' when it run under UTF-8 locale. But on usual system it is run under C locale :(. So, I think some other program should do this (console-tools/kbd?), but this will not fix problem for terminal emulators :(. -- Eugeniy Meshcheryakov Kyiv National Taras Shevchenko University Information and Computing Centre http://icc.univ.kiev.ua
Index: shadow-4.0.3/src/login.c =================================================================== --- shadow-4.0.3.orig/src/login.c 2005-09-27 16:39:15.000000000 +0300 +++ shadow-4.0.3/src/login.c 2005-09-27 16:50:19.000000000 +0300 @@ -38,6 +38,7 @@ #include <errno.h> #include <pwd.h> #include <grp.h> +#include <langinfo.h> #if HAVE_UTMPX_H #include <utmpx.h> #else @@ -199,6 +200,10 @@ static void setup_tty (void) { TERMIO termio; + int in_utf8 = 0; + + if (!strcmp(nl_langinfo(CODESET), "UTF-8")) + in_utf8 = 1; GTTY (0, &termio); /* get terminal characteristics */ @@ -208,6 +213,8 @@ termio.c_lflag |= ISIG | ICANON | ECHO | ECHOE; termio.c_iflag |= ICRNL; + if (in_utf8) + termio.c_iflag |= IUTF8; #if defined(ECHOKE) && defined(ECHOCTL) termio.c_lflag |= ECHOKE | ECHOCTL;
signature.asc
Description: Digital signature