Bug 1047979

Summary: getaddrinfo's canonocal name for entries from /etc/hosts is incorrect
Product: [Fedora] Fedora Reporter: Arjun Shankar <ashankar>
Component: glibcAssignee: Siddhesh Poyarekar <spoyarek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: codonell, fweimer, jakub, law, mnewsome, pfrankli, spoyarek
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: glibc-2.18-12.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1047983 1053443 (view as bug list) Environment:
Last Closed: 2014-02-01 04:03:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1047983, 1053443    
Attachments:
Description Flags
A reproducer none

Description Arjun Shankar 2014-01-02 19:46:12 UTC
Description of problem:

    When getaddrinfo is called with hints.ai_flags |= AI_CANONNAME, and it finds a result from /etc/hosts, the 'canonical name' returned by it must be the value of the first name column in /etc/hosts.

    e.g. for the /etc/hosts line:
    "127.0.0.1    www.fubar.redhat    www", the canonical name is "www.fubar.redhat".

    Currently, this is not returned for AF_INET and AF_INET6 on Fedora 20.

Version-Release number of selected component (if applicable):
    glibc-2.18-11.fc20

How reproducible:
    Always


Steps to Reproduce:
    Run the attached reproducer

Actual results:
    test case reports 'fail'

Expected results:
    test case passes

Additional info:
    The test passes fine on Fedora 18.

Comment 1 Arjun Shankar 2014-01-02 19:47:34 UTC
Created attachment 844691 [details]
A reproducer

Comment 2 Fedora Update System 2014-01-30 10:14:55 UTC
glibc-2.18-12.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/glibc-2.18-12.fc20

Comment 3 Fedora Update System 2014-01-31 04:26:16 UTC
Package glibc-2.18-12.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.18-12.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-1830/glibc-2.18-12.fc20
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2014-02-01 04:03:31 UTC
glibc-2.18-12.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.