Bug 148056 - Unreadable prompts at login on linux console in Japanese
Summary: Unreadable prompts at login on linux console in Japanese
Status: RESOLVED FIXED
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Beta 3
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Thorsten Kukuk
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-03 17:06 UTC by Takashi Iwai
Modified: 2006-02-15 16:29 UTC (History)
2 users (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
bugzilla-148065.patch (1.42 KB, patch)
2006-02-08 12:25 UTC, Mike Fabian
Details | Diff
bugzilla-148065.patch (2.50 KB, patch)
2006-02-15 16:20 UTC, Mike Fabian
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Takashi Iwai 2006-02-03 17:06:21 UTC
When the system is installed with Japanese as the primary language, login shows the password prompt with unreadable letters, and then displays the "Last login: " with also unreadable letters for the date.

This is because linux console cannot show CJK letters as default.  But, the question is why it's shown even the locale of root user doesn't set LANG to ja_JP.UTF-8 at all.  The output of "locale" as root is:

LANG=POSIX
LC_CTYPE=ja_JP.UTF-8
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
Comment 1 Mike Fabian 2006-02-08 12:25:07 UTC
Created attachment 66959 [details]
bugzilla-148065.patch

patch for login.c in the pwdutils package to fix the problem.

Also improves handling of the locale variables, RC_LC_MESSAGES
was ignored.
Comment 2 Mike Fabian 2006-02-08 12:25:58 UTC
Reassign to "pwdutils" maintainer to submit the patch.
Comment 3 Thorsten Kukuk 2006-02-08 12:45:52 UTC
I don't understand: Why do you use such a locale and try to login on console
if the console is not able to use them?
Comment 4 Takashi Iwai 2006-02-08 13:40:47 UTC
The patch above _disables_ the locale setting for languages which don't work with linux console.

RC_LANG is set to ja_JP.UTF-8 when you select japanese in YaST2.  It's not any part of normal locale setting, but only strange programs like /bin/login or yast refer to it.
Comment 5 Mike Fabian 2006-02-08 13:43:51 UTC
Example:

Default installation in Japanese

-> RC_LANG="ja_JP.UTF-8" in /etc/sysconfig/language,
   no other RC_* set in /etc/sysconfig/language.

Now try to login on the Linux console. You see:

    login: root
    ??????:

The row of question marks is the translation of "Password"
in Japanese which cannot be displayed on the Linux console.
Comment 6 Mike Fabian 2006-02-08 13:50:41 UTC
For many languages, e.g. German, French, Russian, which are supported
by the current Linux console, this works just fine and you will see a
readable translation of "Password" when logging in.

But the Linux console currently doesn't support CJK languagues,
Indian languages, Khmer, ...

Maybe one day the Linux console will be improved to support it,
but currently it is not possible.

Therefore I added a list of execptions to login.c. For languages
in this list, the RC_* values from /etc/sysconfig/language are
ignored.

The LC_MESSAGES change was a correctnes fix.



Comment 7 Thorsten Kukuk 2006-02-08 13:52:45 UTC
This all does not even try to answer my question.

About RC_LANG: LANG is set to this value and is part of the normal locale settings.
Comment 8 Mike Fabian 2006-02-08 13:57:49 UTC
But during login, the locale settings are not active because
no profiles have been sourced yet. Therefore, login.c reads
the values directly from /etc/sysconfig/language.
Comment 9 Takashi Iwai 2006-02-08 14:19:17 UTC
Thorsten, please read my original post:  The locale is set to POSIX, indeed (for root user, because of RC_USE_LANG=ctype).  And, user can start fbiterm or whatever after login, so setting that language is also fine.

But, /bin/login shows _always_ broken letters.  That is, the question is not the locale after login but the locale /bin/login uses.
Comment 10 Mike Fabian 2006-02-15 16:20:25 UTC
Created attachment 68660 [details]
bugzilla-148065.patch

improved patch to prever the locale environment variables if set.
Comment 11 Mike Fabian 2006-02-15 16:23:53 UTC
If hte locale environment variables are set, they should probably be
preferred.

They are rarely ever set though when "login" is called because

   - when login is called when loggin in on the linux console or
     via a serial console, no profiles have been sourced yet
   - when login is called from a telnet server, only a few
     environment variables are set, the locale environment variables
     are not set. For example when trying "telnet localhost" I get:

	mfabian@magellan:~$ ps aux | grep login
	root     19206  0.0  0.1  30040   864 ?        Ss   Feb14   0:00 login -- mfabian    
	root     31927  0.0  0.1  22924  1012 pts/16   Ss+  16:27   0:00 /bin/login -h localhost -p
	mfabian   1659  0.0  0.1   5888   864 pts/17   S+   16:27   0:00 grep login
	mfabian@magellan:~$ sudo cat /proc/31927/environ | xargs -0 -n 1 echo
	DISPLAY=magellan.suse.de:0.0
	TERM=mlterm
	REMOTEHOST=localhost
        mfabian@magellan:~$
Comment 12 Mike Fabian 2006-02-15 16:29:16 UTC
Fixed package submitted to STABLE:
-------------------------------------------------------------------
Tue Feb 07 21:28:13 CET 2006 - mfabian@suse.de

- bugzilla #148065: login.c:
  use locale environment variables if available and fall back to
  parsing /etc/sysconfig/language only if not.
  Observe LC_MESSAGE as well and don't use translations for
  languages which cannot be displayed currently on the Linux
  console.

-------------------------------------------------------------------

Closing as FIXED.