LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-14-2013, 08:46 AM   #1
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,331

Rep: Reputation: Disabled
Slackware 13.37 doesn't consider setting of LANG in /etc/profile.d/lang.sh after 'su'


I just installed Slackware 13.37 in a VM to test installing a new slint package.

At end of installation LANG is set to fr_FR.utf8 in /etc/profile.d/lang.sh:
Code:
export LANG=fr_FR.utf8
When I log in as a regular user or as root (either directly or through 'su -'), LANG is properly set. But if I login as a regular user and then get root's privileges with 'su', LANG is unset.

I just installed a fresh Slackware 14.1 as well and then in all cases LANG is set.

I don't understand why behavior is different with Slackware 13.37. Any clue appreciated.

Last edited by Didier Spaier; 12-14-2013 at 10:53 AM. Reason: title edited s/keep/consider/
 
Old 12-14-2013, 11:13 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8120Reputation: 8120Reputation: 8120Reputation: 8120Reputation: 8120Reputation: 8120Reputation: 8120Reputation: 8120Reputation: 8120Reputation: 8120Reputation: 8120
The "su" command does not source /etc/profile and therefore your LANG variable will not be set. That is why we always tell people to use "su -".

Eric
 
Old 12-14-2013, 12:29 PM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,331

Original Poster
Rep: Reputation: Disabled
Yes Eric. But then, why does that work on Slackware64-14.1?
 
Old 12-14-2013, 01:42 PM   #4
ljb643
Member
 
Registered: Nov 2003
Posts: 528

Rep: Reputation: Disabled
This should work, but was broken until Slackware-14.0. "su" (without the - option) should copy almost the entire environment into the new shell. It should copy LANG and therefore the locale will be right. This does not depend on /etc/profile or /etc/profile.d/*. It does work in Slackware 14.0 and 14.1.

Here is the entry from the Slackware-14.0 ChangeLog:
Quote:
a/shadow-4.1.4.3-i486-5.txz: Rebuilt.
Patched a bug where locale variables would be improperly sanitized from
the shell environment. Thanks to Serg Bormant.
It was fixed in August 2012.
 
2 members found this post helpful.
Old 12-14-2013, 02:06 PM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,331

Original Poster
Rep: Reputation: Disabled
I see, thanks. And thanks to Serg. I will write a little warning about that attn folks still wanting that their Slackware 13.37 become polyglot then.

Last edited by Didier Spaier; 12-14-2013 at 02:10 PM.
 
Old 12-14-2013, 02:24 PM   #6
ljb643
Member
 
Registered: Nov 2003
Posts: 528

Rep: Reputation: Disabled
Since Slackware-13.37 and 14.0 use the same version of the Shadow suite (4.1.4.3), it should be possible to patch the shadow package in 13.37 to fix this, if one wanted to. The patch is called r3090.diff.gz and can be found in the Slackware 14.0 source directory a/shadow/patches/.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Signature canonas Linux - Software 3 06-16-2008 04:00 AM
why do settings in /etc/profile.d/lang.sh get overridden? echowarpt Slackware 3 02-19-2007 08:13 PM
What is the use of lang in <head lang=''> tooparam Programming 2 02-01-2006 05:55 PM
Setting of LANG variable r_213 Linux - General 7 01-06-2005 12:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration