LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   13.1-64 SU and locale problem (http://www.linuxquestions.org/questions/slackware-14/13-1-64-su-and-locale-problem-811085/)

Cem3K 05-30-2010 11:47 AM

13.1-64 SU and locale problem
 
Sorry my bad english
Have problem. Lost locale after use SU.

lang.csh:
Code:

setenv LANG ru_RU.UTF-8
lang.csh:
Code:

export LANG=ru_RU.UTF-8
Have this in console:
Code:

bash-4.1$ locale
LANG=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE=C
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=
bash-4.1$ su
Password:
bash-4.1# locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
bash-4.1# exit
exit
bash-4.1$ su -l
Password:
root@darkstar:~# locale
LANG=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE=C
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=

If I use any another locale, en_US for example, problem return again.

bgeddy 05-30-2010 12:04 PM

Running su will not setup the environment properly. You need to run "su -" instead. This will setup root's environment properly.

Cem3K 05-30-2010 12:17 PM

Thanks!
 
Thanks! On 13.0 all worked with "su" only. I will develop a habit to use "su -" :)

bormant 06-16-2010 05:01 AM

Hi,

13.1 has a bug in libmisc/env.c from shadow package. It was introdused with security fixes for GNU gettext.

libmisc/env.c at line 254 in sanitize_env() has typo '!=' and should be
Code:

                        if (strchr (*cur, '/') == NULL) {
instead of
Code:

                        if (strchr (*cur, '/') != NULL) {
Without this fix su breaks LANG, LANGUAGE, LC_* environment variables when they hasn't '/' but should be vice versa.

Fixed in upstream in rev.3090.

"su -", "su -l", "su -l root" start a login shell so execute /etc/profile that calls /etc/profile.d/lang.sh that sets LANG environment variable.


All times are GMT -5. The time now is 04:49 AM.