After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 150025 - gdm2 should support non-UTF-8 /etc/passwd entries
gdm2 should support non-UTF-8 /etc/passwd entries
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.24.x
Other All
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2004-08-13 05:22 UTC by Fabian Fagerholm
Modified: 2009-07-17 02:30 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Convert GECOS field from system locale to UTF-8 when updating GdmUser (586 bytes, patch)
2009-02-21 15:15 UTC, Thomas Quinot
none Details | Review

Description Fabian Fagerholm 2004-08-13 05:23:16 UTC
Distribution: Debian 3.1
Package: gdm
Severity: normal
Version: GNOME2.6.1 2.6.0.x
Gnome-Distributor: Debian
Synopsis: Face browser shows same face and name for all users
Bugzilla-Product: gdm
Bugzilla-Component: general
Bugzilla-Version: 2.6.0.x
Description:
Description of Problem:
The face browser shows the same face and name for all users. Clicking a
name does insert the correct username into the login dialog, but all the
names in the list are the same.

The theme used was "Happy GNOME with Browser".

See also:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=250343




------- Bug moved to this database by unknown@bugzilla.gnome.org 2004-08-13 01:23 -------


Unknown platform unknown. Setting to default platform "Other".
Unknown milestone "unknown" in product "gdm".
   Setting to default milestone for this product, '---'
Setting to default status "UNCONFIRMED".
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.

Comment 1 George Lebl 2004-08-18 19:20:21 UTC
Strange.  Does the standard greeter with browser have the same problem?
Comment 2 Fabian Fagerholm 2004-08-18 19:49:38 UTC
Unfortunately, yes. Any ideas on how to debug this?
Comment 3 Jordi Mallach 2004-10-04 00:03:29 UTC
Hi George,
I just noticed this on my Debian testing system. Funny, as soon as I saw it I knew what was the probable cause...
In my System, there are three users, "Jordi Mallach", and another two with an accented e character in their name.
When these two users were added to the system, the default locale was something latin1, and /etc/password was written using this encoding.
Gdm can't read the user's real name and probably just uses the last name it was able to read correctly (in my case, Jordi Mallach). As soon as I recoded /etc/password as UTF-8, gdm was happy to show the correct user names in the face browser.
Comment 4 Jordi Mallach 2005-01-26 01:13:55 UTC
How is this NOTABUG?

It is quite bad that GDM doesn't handle non-UTF-8 input from /etc/passwd.
Comment 5 Fabian Fagerholm 2005-01-26 06:34:18 UTC
I agree with Jordi and I'm reopening this bug since as the original submitter I
can't see how this is RESOLVED, NOTABUG. Until distributions ship with
/etc/passwd in UTF-8 regardless of system default locale, and until tools that
update it (adduser/useradd, chfn, etc) keep it in that format, GDM should handle
other encodings as well.

I know it's hard to do correct conversions from arbitrary character sets, but
surely GDM could show something more sensible than the last name it read without
problems. The username, for instance, the uid, or, if all else fails, some
default string such as "Non-UTF-8 Name" -- the icon will hopefully disambiguate.
This will draw the attention to the correct place and an admin can correct the
problem.
Comment 6 Brian Cameron 2005-01-26 07:00:15 UTC
Apologies, I now see that this bug should stay open.  I incorrectly read in the
description that the submitter had resolved the problem by changing the person's
name to not use encoding.  I did not realize that /etc/passwd supported UTF-8
input.  Also, the title of the bug is "Face browser shows same face and name for
all users" and not "gdm2 should support UTF-8 /etc/passwd entries".  Since the
problem as stated seemed to have a reasonable workaround, I guess I got excited
and thought the problem was fixed.  I've updated the Synopsys so the confusion
shouldn't happen again.
Comment 7 Fabian Fagerholm 2005-01-26 07:02:14 UTC
I tried to come up with I patch but I ran out of time. It seems that the place
where this stuff is happening is in gui/gdmlogin.c (function
gdm_login_user_alloc()) and/or vicious-extensions/ve-misc.c (function
ve_locale_to_utf8()). Somewhere in there, the GECOS field gets parsed and the
realname aquired, so I suppose this is where any logic can be applied to get a
better result.
Comment 8 Fabian Fagerholm 2005-01-26 07:05:02 UTC
Brian, sorry, I accidentally overwrote your new bug title. I'll fix it now.

However, I think the title should actually be "gdm2 should support non-UTF-8
/etc/passwd entries". Tiny detail but oh so important ;-)
Comment 9 Brian Cameron 2005-01-26 07:55:34 UTC
Thanks for fixing the title.  Getting gdm2 to support languages in this way is a
cool feature.  I'm not familiar with how to fix this problem.  Anybody on this
bug know who would be a good person to highlight what code changes would be
necessary?
Comment 10 Fabian Fagerholm 2006-04-18 09:45:04 UTC
I'm happy to say that this issue now seems to be resolved for me. It's a bit hard to tell what the actual fix was, since everything (including the hardware) has changed for me since opening this bug...

Anyway, I'm now running gdm 2.13.0.10-2 (Debian version) and Debian etch (testing), and the problem doesn't show up here anymore.
Comment 11 Fabian Fagerholm 2006-04-18 10:02:47 UTC
Ahem... Sorry for spamming, but thinking back, there was a reason for changing the bug title. It turns out that Debian etch uses UTF-8 for /etc/passwd, and thus it plays nicely with GDM.

I took the original /etc/passwd from my old machine. It's in ISO-8859. And GDM does choke on it just like it did before. So even though the problem is probably less visible now (I presume other distributions have also moved to UTF-8 /etc/passwd entries), technically, it's still there.
Comment 12 Thomas Quinot 2009-02-21 15:12:43 UTC
Hi, I think I just stumbled on this very issue today. Symptom was a crash of gdm-simple-greeter at an early step (thus preventing any graphical login on the machine :-( ) due to g_utf8_collate segfaulting on non-UTF8 strings.

The attached patch appeared to fix the issue here.
Comment 13 Thomas Quinot 2009-02-21 15:15:09 UTC
Created attachment 129216 [details] [review]
Convert GECOS field from system locale to UTF-8 when updating GdmUser
Comment 14 Brian Cameron 2009-02-25 01:26:36 UTC
Note the patch is against GDM 2.24, so resetting version to this.  This doesn't seem to be a GDM 2.6 patch, anyway.
Comment 15 Ray Strode [halfline] 2009-07-17 02:30:07 UTC
Looks like this got fixed independently as part of bug 588031