[Bug 236063] New: lang.csh can leave LANG, LC_ALL shell variables set
https://bugzilla.novell.com/show_bug.cgi?id=236063 Summary: lang.csh can leave LANG, LC_ALL shell variables set Product: openSUSE 10.2 Version: Final Platform: All OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jmichaud@sgi.com QAContact: qa@suse.de When tcsh is invoked it sources the profile.d scripts (including lang.csh). lang.csh sets the environment variables according to what is set in the /etc/sysconfig/language file. Unfortunately, in the processing, lang.csh sets the *shell* variables but doesn't *unset* them. lang.csh: .. 18 if ( -s /etc/sysconfig/language ) then 19 eval `sed -n \ 20 -e 's/^RC_\(\(LANG\|LC_[A-Z_]\+\)\)=/set \1=/p' \ 21 -e 's/^\(ROOT_USES_LANG\)=/set \1=/p' \ 22 < /etc/sysconfig/language` 23 if ( "$uid" != 0 ) set ROOT_USES_LANG=yes 24 endif 25 if ( -s $HOME/.i18n ) then 26 eval `sed -n \ 27 -e 's/^\(\(LANG\|LC_[A-Z_]\+\)\)=/set \1=/p' \ 28 < $HOME/.i18n 29 endif 30 31 # 32 # Handle all LC and the LANG variable 33 # 34 foreach lc (LANG LC_CTYPE LC_NUMERIC LC_TIME \ 35 LC_COLLATE LC_MONETARY LC_MESSAGES \ 36 LC_PAPER LC_NAME LC_ADDRESS \ 37 LC_TELEPHONE LC_MEASUREMENT \ 38 LC_IDENTIFICATION LC_ALL) 39 eval set val=\${\?$lc} 40 if ( $val == 0 ) continue 41 eval set val=\$$lc 42 if ( "$ROOT_USES_LANG" == "yes" ) then 43 if ( ${%val} == 0 ) then 44 eval unsetenv $lc 45 eval unset $lc 46 else 47 eval setenv $lc $val 48 endif 49 else if ( "$ROOT_USES_LANG" == "ctype" ) then .. The *shell* variables LANG and others are set on line 19. For normal users, the empty shell variables are unset on line 45. Environment variables to be set are done on line 47 but the *shell* variable is not (properly) unset. The following example shows the resulting confusion: iron-penguin 111% iron-penguin 111% grep RC_LANG= /etc/sysconfig/language RC_LANG="en_US.UTF-8" iron-penguin 112% setenv LANG C iron-penguin 113% env | grep LANG LANG=C iron-penguin 114% echo $LANG en_US.UTF-8 iron-penguin 115% The same issue appears to exist for the lang.sh file. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=236063 chrubis@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |ro@novell.com |screening@forge.provo.novell| |.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=236063 ro@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|ro@novell.com |werner@novell.com ------- Comment #1 from ro@novell.com 2007-01-18 03:40 MST ------- Werner: any idea ? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=236063 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED ------- Comment #2 from werner@novell.com 2007-01-18 11:54 MST ------- Ok veryfied for (t)csh, nevertheless, the environment variable is exported correctly, only the echo reports the shell variable. Beside this the (ba)sh uses the same variable space therefore an unset would remove even an exported variable. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=236063 ------- Comment #3 from werner@novell.com 2007-01-19 05:47 MST ------- Created an attachment (id=113882) --> (https://bugzilla.novell.com/attachment.cgi?id=113882&action=view) fixed /etc/profile.d/lang.csh this version should not show the problem of the different ahndling of shell and environment variables within the tcsh. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=236063 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED ------- Comment #4 from werner@novell.com 2007-01-19 05:58 MST ------- submitted to openSuSE 10.3 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=236063 ------- Comment #5 from jmichaud@sgi.com 2007-01-22 14:54 MST ------- (In reply to comment #4)
submitted to openSuSE 10.3
Absolutely correct about (ba)sh (what was I thinking...) I've also verified your fix. Looks good. Thanks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=236063
User hmuelle@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=236063#c6
Harald Mueller-Ney
participants (1)
-
bugzilla_noreply@novell.com