GNOME Bugzilla – Bug 150025
gdm2 should support non-UTF-8 /etc/passwd entries
Last modified: 2009-07-17 02:30:07 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.
Strange. Does the standard greeter with browser have the same problem?
Unfortunately, yes. Any ideas on how to debug this?
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.
How is this NOTABUG? It is quite bad that GDM doesn't handle non-UTF-8 input from /etc/passwd.
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.
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.
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.
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 ;-)
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?
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.
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.
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.
Created attachment 129216 [details] [review] Convert GECOS field from system locale to UTF-8 when updating GdmUser
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.
Looks like this got fixed independently as part of bug 588031