[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#632798: libc6: broken LANGUAGE design



Vincent Lefevre wrote:

> My settings come from the installation. /etc/default/locale was:
>
> #  File generated by update-locale
> #LANG="en_US.UTF-8"
> LANGUAGE="en_US:en"

Ah.  localechooser sets LANGUAGE up, and then update-locale from the
"locales" package preserves it.

The weird part is that debconf ("dpkg-reconfigure locales") controls
the LANG setting but LANGUAGE has to be changed more directly
("update-locale LANGUAGE=foo").  See (*), below.

> Now, if LANGUAGE is set in /etc/default/locale, this change may not
> solve the problem due to:
>
>   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=313317

Wow.  The upstream discussion went nowhere fast.  Have you tried the
patch, and does it work well?

> However, even if this ssh bug is fixed, in case LANGUAGE is not
> defined on the ssh client's side, the system must not set it by
> default in the user's back. So, in short, LANGUAGE should not be
> set in /etc/default/locale.

I am not sure I agree, even though I have my system set up locally
not to define LANGUAGE.  If ssh were to transmit it and let it
override /etc/default/locale, wouldn't sending LANGUAGE="" work?

 $ LANGUAGE= LC_ALL=de_DE.UTF-8 cp
 cp: Fehlendes Dateioperand
 „cp --help“ gibt weitere Informationen.

>> 	LANGUAGE=fr:de
>> 	LC_MESSAGES=de
>> 
>>    on an installation where most programs are translated to German.
>>    (It means: programs using catgets should use German, while programs
>>    using gettext should prefer French if possible.  Intent: "I'd
>>    prefer French, but barring that, please give me German instead of
>>    English").
>
> Hmm... OK, I thought that all programs were using gettext.

The authors of update-locale must have thought the same thing.

	# update-locale LANG=de_DE.UTF-8 LANGUAGE=fr:de
	*** update-locale: Warning: LANGUAGE (fr:de) is not compatible with
	LANG (de_DE.UTF-8). Disabling it.

See Bug#596695 for the strange history that led to that.

This seems mildly broken.  Consider the following sequence of
events: (*)

 1. Install, telling localechooser to use language A.
 2. Reconfigure using dpkg-reconfigure to switch to language B.
 3. Reconfigure using dpkg-reconfigure to switch back to language A.

At step 1, LANG and LANGUAGE are set.  At step 2, locales.postinst
decides what LANG should be.  LANG and LANGUAGE are mismatched, so the
LANGUAGE line is automatically commented.  At step 3, locales.postinst
sets LANG back, but LANGUAGE is still commented.

At last, the old mystery (1) is solved.  The above must be what
allowed LANGUAGE to be set on your system and not set on mine.

Summary of proposed changes
---------------------------

openssh-server Bug#313317:

 * Let user envvars from the whitelist override pam.  There's a patch
   already; we should just make sure it still works, ping upstream,
   and consider applying it in the meantime as a Debian-specific
   change.

Additional bugs to be cloned from this one:

 * openssh-server: expand the default envvar whitelist to include
   LANGUAGE
 * libc6: let C.UTF-8 locale suppress LANGUAGE, just like C does
 * libc6: let LANGUAGE take effect even if LC_MESSAGES refers to
   a non-existent locale
 * libc6: implicitly add LC_MESSAGES to the beginning of the
   LANGUAGE list, except when it is already in the list
 * locales: when changing the default locale, update LANGUAGE at the
   same time, so the resulting configuration can be more similar to
   what localechooser would write.

Thanks again for all your help.



Reply to: