RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1452034 - when the /etc/hosts file has a line longer than 1028 characters getent ahostsv4 and ahostsv6 will stop working.
Summary: when the /etc/hosts file has a line longer than 1028 characters getent ahosts...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.3
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Florian Weimer
QA Contact: qe-baseos-tools-bugs
Vladimír Slávik
URL:
Whiteboard:
Depends On:
Blocks: 1420851 1452032
TreeView+ depends on / blocked
 
Reported: 2017-05-18 08:13 UTC by Raul Mahiques
Modified: 2020-12-14 08:41 UTC (History)
11 users (show)

Fixed In Version: glibc-2.17-202.el7
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of: 1452032
Environment:
Last Closed: 2018-04-10 13:58:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3047071 0 None None None 2017-05-22 13:48:35 UTC
Red Hat Product Errata RHSA-2018:0805 0 None None None 2018-04-10 14:00:11 UTC
Sourceware 21915 0 P2 RESOLVED nss_files can return with NSS_STATUS_SUCCESS and a clobbered errno value, causing getaddrinfo to fail 2020-12-24 16:13:40 UTC

Description Raul Mahiques 2017-05-18 08:13:19 UTC
+++ This bug was initially created as a clone of Bug #1452032 +++

Description of problem:
when the /etc/hosts file has a line longer than 1028 characters getent ahostsv4 and ahostsv6 will stop working for hostsnames present in /etc/hosts.
This happens even if the line is a comment.

Version-Release number of selected component (if applicable):
Tested in RHEL 6.9 and RHEL 7.3
glibc-2.17-157
glibc-2.12-1

How reproducible:
Always




Steps to Reproduce:
With this oneliner you can see how it stops resolving after the line reaches 1028 characters, even if it's commented.
echo -n '#' >>/etc/hosts ; for i in $(seq 1 1030); do echo -n "$i - "; echo -n 'a' >>/etc/hosts ; getent ahostsv4 `hostname -f`; done


Actual results:
It stops working after 1028 characters.

Expected results:
It continues working and at least ignores the commented line

Additional info:

--- Additional comment from Red Hat Bugzilla Rules Engine on 2017-05-18 04:12:24 EDT ---

Since this bug report was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.

Comment 5 Florian Weimer 2017-08-02 18:02:44 UTC
The core issue is that getaddrinfo looks at h_errno even if nss_files returns NSS_STATUS_SUCCESS.  The reproducer triggers an internal failure within nss_files, which overwrites h_errno, although the nss_files succeeds eventually.

Upstream, we will fix this by changing getaddrinfo, but *how* is not completely clear to me yet.

Downstream, we can either rebase getaddrinfo (more or less required to fix bug 168253), or patch nss_files not to leak the temporary h_errno value in this case.

Comment 6 Florian Weimer 2017-08-11 10:52:44 UTC
Upstream patch posted: https://sourceware.org/ml/libc-alpha/2017-08/msg00292.html

Comment 16 errata-xmlrpc 2018-04-10 13:58:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0805


Note You need to log in before you can comment on or make changes to this bug.