Bug 91403 - xinetd uses inappropriate locale settings
xinetd uses inappropriate locale settings
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: xinetd (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jay Fenlason
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-22 08:17 EDT by Paul Gear
Modified: 2014-08-31 19:25 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-08-11 13:08:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Proposed patch for /etc/rc.d/init.d/xinetd (644 bytes, patch)
2003-05-22 08:18 EDT, Paul Gear
no flags Details | Diff
Second proposed patch for /etc/rc.d/init.d/xinetd (929 bytes, patch)
2003-05-22 08:29 EDT, Paul Gear
no flags Details | Diff

  None (edit)
Description Paul Gear 2003-05-22 08:17:25 EDT
Description of problem:
See description of bug 43762 for a more agressive (but accurate) version of this
bug.

Version-Release number of selected component (if applicable):
2.3.11-1.9.0

How reproducible:
Always

Steps to Reproduce:
In the above-mentioned bug, teg@redhat.com states that: 'en_US is "C", with
working character order and 8 bit characters.'  This should say, 'with
*different* character order'.  If xinetd is going to provide a default, it
should provide the default that makes most sense - that is, nothing.  Every time
xinetd is upgraded, i have to edit /etc/rc.d/init.d/xinetd to restore the
default behaviour.  An extract follows:

    # Need to get rid of localization for external services - 
    # it doesn't make much sense to have i18n on the server side here

    LANG=en_US
    LC_TIME=en_US
    LC_ALL=en_US
    LC_MESSAGES=en_US
    LC_NUMERIC=en_US
    LC_MONETARY=en_US
    LC_COLLATE=en_US
    export LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE
The comment is not an accurate reflection of the code - en_US is just as much a
localization as any other.  If we were indeed getting rid of localization, the
above should read:
    unset LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE

Actual results:
/tmp $ mkdir a
/tmp $ cd a
/tmp/a $ touch A b C d E f G
/tmp/a $ LANG=en_US ls 
.  ..  A  b  C  d  E  f  G
/tmp/a $ LANG=C ls 
.  ..  A  C  E  G  b  d  f
This shows that LANG=en_US does not achieve the same result as LANG=C.

Expected results:
The same as it was before: no LANG setting in programs started from xinetd,
except what is set by themselves.  This allows programs which need localization
to sensibly test whether it is in place already or not.

Additional info:
At the very least, the comment in the xinetd startup script should be corrected
to state that we are using Red Hat's default choice for localization rather than
saying we are getting rid of it, and bug 43762 should be updated to "WONTFIX"
rather than "NOTABUG".
Comment 1 Paul Gear 2003-05-22 08:18:50 EDT
Created attachment 91888 [details]
Proposed patch for /etc/rc.d/init.d/xinetd
Comment 2 Paul Gear 2003-05-22 08:29:06 EDT
Created attachment 91889 [details]
Second proposed patch for /etc/rc.d/init.d/xinetd

On second thoughts, this patch is probably more flexible.  It would allow those
of us who want the old behaviour to put XINETD_UNSET_LANG=1 in our
/etc/sysconfig/xinetd, and the rest could have it the new way.	I would be
happy for XINETD_UNSET_LANG=0 to be the default, or even for it to be unset and
undocumented.  As athompso@athompso.net said in bug 43762, we need an easy way
to get the traditional behaviour, and one that doesn't require manual
intervention every time xinetd gets upgraded.
Comment 3 Jay Fenlason 2003-08-11 13:08:31 EDT
I came up with a slightly different patch, which I included in 
xinetd-2.3.12-1.10.0 (now in Raw Hide).  In /etc/sysconfig/xinetd, I added an 
XINETD_LANG paramater, which can be set to a locale, or the string "none".  If 
it's "none", all locale environment variables are cleared before xinetd is 
run.  Otherwise, xinetd runs in the specified locale.  The default 
configuration file sets it to "en_US", so default users get the old behavior. 
 
I don't know if xinetd-2.3.12-1.10.0 will run on a Red Hat Linux 9 system, but 
you can certainly download the SRPM and do a rpmbuild --rebuild on it. 
Comment 4 Paul Gear 2003-08-13 05:39:38 EDT
There's a typo in the comments in /etc/init.d/xinetd (synconfig vs. sysconfig),
but otherwise looks good.  I've thrown a comment in 43762 to point people this way.

Note You need to log in before you can comment on or make changes to this bug.