Bug 188281

Summary: getaddrinfo sensible to previous errno when nisplus enabled
Product: [Fedora] Fedora Reporter: Donald Cohen <don-redhat-z6y>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED DUPLICATE QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 5CC: bugzilla.redhat.com, chris.walter, don-redhat-z6y, hongjiu.lu, jmccann, pb, rdtennent, shikkie+rhbugzilla
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-04-07 16:32:13 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:

Description Donald Cohen 2006-04-07 16:26:56 UTC
+++ This bug was initially created as a clone of Bug #186592 +++

Description of problem:
It looks to me like the resolution here was to remove nisplus from the
nsswitch file.  I think there's a more fundamental underlying problem.
Even if the nsswitch file does contain something like
 file nisplus dns
the lookups ought to work, right?  
Is nisplus somehow reporting that there is no answer, as opposed
to reporting that it does not know the answer?

[I leave the original text below]

getaddrinfo fails with latest errno status if nisplus is present in hosts
section of nsswitch.conf

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

glibc-2.4-4

How reproducible:

always

Steps to Reproduce:

have e.g. the following line in nsswitch.conf:

hosts: files nisplus dns

try the following code snippet:

errno = EBADF;
rc = getaddrinfo("www.google.com", NULL, NULL, &res);

Actual results:

rc is EAI_SYSTEM, with latest errno as it was.

Expected results:

rc should be zero

Additional info:

affects for instance wget:

tate ~ $ wget http://www.google.com/
--17:19:50--  http://www.google.com/
           => `index.html'
Resolving www.google.com... failed: No such file or directory.


I know that nisplus isn't supported (cf bug 159279) ; however I've had this
cruft in nsswitch.conf files for a long time, and even though useless, having
nisplus mentioned hasn't been disruptive so far -- why should it break things now ?

-- Additional comment from jakub on 2006-03-24 16:36 EST --
http://sources.redhat.com/ml/libc-hacker/2006-03/msg00038.html

The right thing to do is certainly to remove nisplus from nsswitch.conf
unless you are using NIS+ though.

-- Additional comment from jakub on 2006-03-24 16:37 EST --
*** Bug 186626 has been marked as a duplicate of this bug. ***

-- Additional comment from katzj on 2006-03-28 14:27 EST --
*** Bug 186661 has been marked as a duplicate of this bug. ***

-- Additional comment from chris.walter on 2006-03-29 10:27 EST --
Sorry.  I accidently added this comment to a duplicate.  I am re-entering it here:

I had the same problem on FC4 after the recent update to glibc-2.3.6-3



-- Additional comment from jakub on 2006-03-29 11:44 EST --
Should be fixed in rawhide glibc-2.4-5 (can be used in FC5 without fears too).
Please test it, whenever is FC5 glibc updated, it will be fixed there too.

-- Additional comment from pb on 2006-03-30 07:36 EST --
Same happen to me after update in FC4 to latest version and after cross-grade
from  RHL7.3 to FC5.

BTW: can one tell me why
1) after update, the new nsswitch.conf file was created as nsswitch.conf.rpmnew,
but there were no changes made before to the old one

2) why
# rpm -qf /etc/nsswitch.conf
glibc-2.3.6-3

but 
# rpm -V glibc

shows nothing after upgrade, but still old nsswitch.conf (I would expect that
/etc/nsswitch.conf would appear, also /etc/localtime, but that's another issue)

-- Additional comment from pb on 2006-03-30 07:51 EST --
Regarding to the rpm -V glibc do not show any changed files, can it be that
/etc/nsswitch.conf is specified in glibc.spec with %verify(not md5 size mtime)?
Makes this sense?



-- Additional comment from jakub on 2006-03-30 08:22 EST --
*** Bug 187320 has been marked as a duplicate of this bug. ***

-- Additional comment from jakub on 2006-04-03 07:17 EST --
*** Bug 187676 has been marked as a duplicate of this bug. ***

-- Additional comment from jakub on 2006-04-07 05:30 EST --
*** Bug 188212 has been marked as a duplicate of this bug. ***

Comment 1 Jakub Jelinek 2006-04-07 16:32:13 UTC
Can you read the #186592 bugreport?  All the info is there.
Yes, there is a bug in FC5 (and FC4 updates) glibc, it has been fixed in
rawhide glibc and eventually when a few other glibc fixes are done, it will
be released as FC5 update (and for FC4 similarly).
In the mean time, you can test rawhide glibc, or, as a workaround, you can
remove nisplus from your /etc/nsswitch.conf unless you are actually using it.
That's a good idea anyway, as it only slows things down when NIS+ is not
configured, but present in nsswitch.conf.

*** This bug has been marked as a duplicate of 186592 ***