Bug 199721 - Authd always returns error if locale file is missing
Authd always returns error if locale file is missing
Product: Fedora
Classification: Fedora
Component: authd (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Martin Stransky
Depends On:
  Show dependency treegraph
Reported: 2006-07-21 11:44 EDT by Ian Dall
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-07-25 01:18:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to reset errno, after call to setlocale(). (459 bytes, patch)
2006-07-21 11:44 EDT, Ian Dall
no flags Details | Diff

  None (edit)
Description Ian Dall 2006-07-21 11:44:48 EDT
Description of problem:

authd always returns an error if locale file is missing

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


How reproducible:


Steps to Reproduce:
1. make sure there is a socket open on localhost
2. use netstat -t to find port numbers
3. LANG=en_AU in.authd <lport>,<rport>
Actual results:
<lport> , <rport> : ERROR :NO-USER

Expected results:

<lport> , <rport> : USERID : UNIX :<user>

Additional info:

This happens provided that LANG is set to a locale which doesn't have an
auth.mo file. What happens is the errno gets set to ENOENT and is never cleared.
Later code assumes that this is an error, even if a matching socket is found.

Probably errno should be cleared after setlocale is called. See attached patch,
which is only a partial solution as setlocale can also be called to handle a
command line language setting.
Comment 1 Ian Dall 2006-07-21 11:44:48 EDT
Created attachment 132820 [details]
Patch to reset errno, after call to setlocale().
Comment 2 Martin Stransky 2006-07-25 01:09:20 EDT
I think setlocale doesn't set the errno value. And if setlocale fails, authd
will abort, so this ENOENT must come from a different source.... 
Comment 3 Martin Stransky 2006-07-25 01:18:38 EDT
Hm, this problem looks like an undocumented feature of setlocale(). This patch
can't break anything so I'll apply it.

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