Red Hat Bugzilla – Bug 199721
Authd always returns error if locale file is missing
Last modified: 2007-11-30 17:11:38 EST
Description of problem:
authd always returns an error if locale file is missing
Version-Release number of selected component (if applicable):
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>
<lport> , <rport> : ERROR :NO-USER
<lport> , <rport> : USERID : UNIX :<user>
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.
Created attachment 132820 [details]
Patch to reset errno, after call to setlocale().
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....
Hm, this problem looks like an undocumented feature of setlocale(). This patch
can't break anything so I'll apply it.