Bug 199721

Summary: Authd always returns error if locale file is missing
Product: [Fedora] Fedora Reporter: Ian Dall <ian>
Component: authdAssignee: Martin Stransky <stransky>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-07-25 05:18:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to reset errno, after call to setlocale(). none

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.