Bug#471508: gdm: GDM_LANG set even when 'System Default' is selected as language
Lionel Elie Mamane
lionel at mamane.lu
Tue Mar 18 15:56:20 UTC 2008
Package: gdm
Version: 2.20.1-2
Severity: normal
(Bug has been reproduced on 2.20.1-2 and 2.20.3-1.)
The documentation says:
Since many systems reset the language selections done by GDM, GDM
will also set the <filename>$GDM_LANG</filename> variable to the
selected language. You can use this to reset the language
environmental variables after you run the user's profile. If the
user elected to use the system language, then
<filename>$GDM_LANG</filename> is not set.
But gdm does not behave as the last sentence specifies; in this case
it sets GDM_LANG to the system default language, or to "C" if there is
no system default language. The cause of this is this bit of code in
function gdm_slave_session_start in daemon/slave.c:
has_language = (language != NULL) && (language[0] != '\0');
if ((gdm_system_locale != NULL) && (!has_language)) {
lang = gdm_system_locale;
} else {
lang = language;
}
lang is then passed as the language parameter of the session_child_run
function, but session_child_run expects language to be NULL or an
empty string if the user asked for the "System Default" language, as
made clear by this comment and code:
/* Only force GDM_LANG to something if there is other then
* system default selected. Else let the session do whatever it
* does since we're using sys default */
if ( ! ve_string_empty (language)) {
g_setenv ("LANG", language, TRUE);
g_setenv ("GDM_LANG", language, TRUE);
}
The reason I find the current behaviour annoying (and how I found the
bug) is that this leads to xfce4-session to overwrite the LANG in my
~/.profile (or ~/.xprofile) with the system default locale (because
that's what in GDM_LANG). I don't think this is a bug in
xfce4-session, because: this allows a locale selection made in the gdm
chooser menu to overwrite whatever is in ~/.profile (or
~/.xprofile). That's good. But "System default" should _not_ overwrite
whatever is in ~/.profile (or ~/.xprofile), and if gdm behaved as its
documentation says, it would not. (Maybe it would more aptly be named
just "Default" instead of "System Default".)
I suggest that the has_language code bit be completely removed, as it
serves no purpose. If the user wants "System Default", then LANG will
_already_ be to the right value, no need for session_run_child to muck
with it.
And once GDM_LANG is sane again, I suggest that Xsession do as
xfce4-session does now, that is overwrite LANG with its value.
--
Lionel
More information about the pkg-gnome-maintainers
mailing list