Bug 199721 - Authd always returns error if locale file is missing
Summary: Authd always returns error if locale file is missing
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: authd
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Martin Stransky
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-07-21 15:44 UTC by Ian Dall
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-07-25 05:18:38 UTC
Type: ---
Embargoed:


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

Description Ian Dall 2006-07-21 15:44:48 UTC
Description of problem:

authd always returns an error if locale file is missing

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

authd-1.4.3-8.1

How reproducible:

Always

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 15:44:48 UTC
Created attachment 132820 [details]
Patch to reset errno, after call to setlocale().

Comment 2 Martin Stransky 2006-07-25 05:09:20 UTC
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 05:18:38 UTC
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.