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 587949 - gnome-shell doesn't handle correctly username in non-utf8 locale
gnome-shell doesn't handle correctly username in non-utf8 locale
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks: 588031
 
 
Reported: 2009-07-07 09:46 UTC by Frederic Crozat
Modified: 2009-07-10 18:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Bug 587949 - Handle locale-encoded names from struct pwent (1.47 KB, patch)
2009-07-08 01:00 UTC, Colin Walters
reviewed Details | Review
Merge up to commit 92e608bd0f3807314c45ee5f5daf6ba781c27d58 of gdm (1.12 KB, patch)
2009-07-08 01:03 UTC, Colin Walters
reviewed Details | Review

Description Frederic Crozat 2009-07-07 09:46:16 UTC
when running in non-UTF8 locale (for instance, fr_FR.ISO-8859-15), if username is containing non ASCII characters (for instance, Frédéric Crozat), no conversion from current locale to UTF-8 is done in gdmuser/gdm-user-manager.c, some g_locale_to_utf8 calls are missing.
Comment 1 Owen Taylor 2009-07-07 11:24:46 UTC
Should check if this fix has already been done in gdm and if there are any other fixes that need to be merged up.

(Hopefully things haven't diverged that much)
Comment 2 Colin Walters 2009-07-08 01:00:00 UTC
Created attachment 138007 [details] [review]
Bug 587949 - Handle locale-encoded names from struct pwent

Convert to utf8 internally.
Comment 3 Colin Walters 2009-07-08 01:03:25 UTC
Created attachment 138008 [details] [review]
Merge up to commit 92e608bd0f3807314c45ee5f5daf6ba781c27d58 of gdm

Pull in a few fixes from gdm trunk for gdm-user.c
Comment 4 Dan Winship 2009-07-08 13:47:59 UTC
Looks good.

    if (first_comma) {
-           real_name = g_strndup (pwent->pw_gecos,
-                                  (first_comma - pwent->pw_gecos));
+           real_name = g_strndup (real_name_utf8, first_comma - real_name_utf8);
+           g_free (real_name_utf8);
    } else {

You could avoid a malloc/free by just doing

    if (first_comma)
            *first_comma = '\0';

Comment 5 Colin Walters 2009-07-10 18:19:53 UTC
Well, then I'd have to strdup in the other path (which is probably the common one).  Thanks for review!