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 1090948 - Default settings for hosts.byname and hosts.byaddr NIS maps are incorrect
Summary: Default settings for hosts.byname and hosts.byaddr NIS maps are incorrect
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: slapi-nis
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Nalin Dahyabhai
QA Contact: Namita Soman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-24 12:55 UTC by Nalin Dahyabhai
Modified: 2015-03-05 10:26 UTC (History)
1 user (show)

Fixed In Version: slapi-nis-0.52-5.el7
Doc Type: Bug Fix
Doc Text:
Cause: Due to incorrect default settings, directory servers which were configured to serve host address information in the form of NIS "hosts.byname" and "hosts.byaddr" maps would produce map entry values in which the first field was a host name rather than an IP address. Consequence: Clients would typically discard the value obtained from the NIS server, and proceed as if no matching entry had been found in the NIS map. Fix: The defaults have been corrected. Result: Clients should be able to parse host address information which they retrieve from servers which are configured to provided it.
Clone Of:
Environment:
Last Closed: 2015-03-05 10:26:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0445 0 normal SHIPPED_LIVE slapi-nis bug fix and enhancement update 2015-03-05 15:05:04 UTC

Description Nalin Dahyabhai 2014-04-24 12:55:37 UTC
Description of problem:
It looks like the default settings for how slapi-nis formats entry data for the NIS "hosts.byname" and "hosts.byaddr" maps are wrong.

Version-Release number of selected component (if applicable):
slapi-nis older than 0.53

How reproducible:
Always

Steps to Reproduce:
1. Add LDAP entries with objectclass ipHost (or just containing one or more ipHostNumber and cn values).
2. Enable NIS maps named hosts.byaddr and hosts.byname, leaving the key and value format attributes unspecified. 
3. Use ypcat to verify that the maps have contents.
4. Set up ypbind to point to your server.
5. Attempt to read the map using the libc APIs using 'getent -s nis hosts'.

Actual results:
Output at step 4, no output at step 5.

Expected results:
Output at both steps 4 and 5.

Additional info:
The defaults have been wrong since they were first added.  The fix included in the upstream 0.53 release is:
https://git.fedorahosted.org/cgit/slapi-nis.git/commit/?id=6262fd4ebc514b8c6ba80f25a21b8837e6a47ce2

Comment 1 Nalin Dahyabhai 2014-04-24 13:04:21 UTC
For reference, when enumerating hosts, glibc walks hosts.byname, so we'd have to verify hosts.byaddr by asking 'getent' for the entry for a particular IP address.

Comment 3 Namita Soman 2015-01-22 17:08:05 UTC
Verified using
slapi-nis-0.54-2.el7.x86_64
ipa-server-4.1.0-15.el7.x86_64

After running NIS integration test suite, used the env and verified with following steps:
# ypcat  -d ipatest -h vm-idm-008.lab.eng.pnq.redhat.com hosts.byname
192.168.4.1	goodhost1
192.168.4.2	goodhost2
192.168.4.3	goodhost3
192.168.4.4	goodhost4
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

^^ matches /etc/hosts format when not using the -k option

# ypcat -k -d ipatest -h vm-idm-008.lab.eng.pnq.redhat.com hosts.byname
goodhost1 192.168.4.1	goodhost1
goodhost2 192.168.4.2	goodhost2
goodhost3 192.168.4.3	goodhost3
goodhost4 192.168.4.4	goodhost4
localhost 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
localhost.localdomain 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
localhost4 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
localhost4.localdomain4 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

^^ first entry is the name

# ypcat -k -d ipatest -h vm-idm-008.lab.eng.pnq.redhat.com hosts.byaddr
127.0.0.1 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.4.1 192.168.4.1	goodhost1
192.168.4.2 192.168.4.2	goodhost2
192.168.4.3 192.168.4.3	goodhost3
192.168.4.4 192.168.4.4	goodhost4
::1 ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

^^ first entry is the addr

Comment 4 Namita Soman 2015-01-22 18:14:31 UTC
Disregard above verification.

Followed steps below to verify:

On ipa server, where ipa nis listener nis enabled (after running the test suite, it is)

Added maps to enable hosts.byname, hosts.byaddr:
dn: nis-domain=testrelm.test+nis-map=hosts.byaddr,cn=NIS Server,cn=plugins,cn=config
objectClass: top
objectClass: extensibleObject
nis-map:hosts.byaddr
nis-base: cn=computers, cn=accounts, dc=testrelm,dc=test
nis-domain: testrelm.test
nis-secure: no

dn: nis-domain=testrelm.test+nis-map=hosts.byname,cn=NIS Server,cn=plugins,cn=config
objectClass: top
objectClass: extensibleObject
nis-map:hosts.byname
nis-base: cn=computers, cn=accounts, dc=testrelm,dc=test
nis-domain: testrelm.test
nis-secure: no

ldapadd -x -D "cn=Directory Manager" -w Secret123 -h `hostname` -f <above filename>

used ldif to add host with ipHostNumber:
dn: fqdn=nkhost1.testrelm.test,cn=computers,cn=accounts,dc=testrelm,dc=test
cn: nkhost1.testrelm.test
objectClass: ipaobject
objectClass: nshost
objectClass: ipahost
objectClass: ipHost
objectClass: pkiuser
objectClass: ipaservice
objectClass: krbprincipalaux
objectClass: krbprincipal
objectClass: ieee802device
objectClass: ipasshhost
objectClass: top
objectClass: ipaSshGroupOfPubKeys
fqdn: nkhost1.testrelm.test
managedBy: fqdn=nkhost1.testrelm.test,cn=computers,cn=accounts,dc=testrelm,dc=test
krbPrincipalName: host/nkhost1.testrelm.test
serverHostName: nkhost1
ipHostNumber: 192.168.4.5


ldapadd -x -D "cn=Directory Manager" -w Secret123 -h `hostname` -f  <above filename>

# ipa host-show nkhost1.testrelm.test --all --raw
  dn: fqdn=nkhost1.testrelm.test,cn=computers,cn=accounts,dc=testrelm,dc=test
  fqdn: nkhost1.testrelm.test
  krbprincipalname: host/nkhost1.testrelm.test
  has_password: FALSE
  has_keytab: FALSE
  managedby: fqdn=nkhost1.testrelm.test,cn=computers,cn=accounts,dc=testrelm,dc=test
  cn: nkhost1.testrelm.test
  ipHostNumber: 192.168.4.5
  ipaUniqueID: ba4a5ae4-a260-11e4-88a5-52540082f3e4
  managing: fqdn=nkhost1.testrelm.test,cn=computers,cn=accounts,dc=testrelm,dc=test
  objectClass: ipaobject
  objectClass: nshost
  objectClass: ipahost
  objectClass: ipHost
  objectClass: pkiuser
  objectClass: ipaservice
  objectClass: krbprincipalaux
  objectClass: krbprincipal
  objectClass: ieee802device
  objectClass: ipasshhost
  objectClass: top
  objectClass: ipaSshGroupOfPubKeys
  serverHostName: nkhost1

note it has the ipHostNumber

# ypcat  -d testrelm.test -h `hostname` hosts.byname
192.168.4.5 nkhost1.testrelm.test

# ypcat -k -d testrelm.test -h `hostname` hosts.byaddr
192.168.4.5 192.168.4.5 nkhost1.testrelm.test

# ypcat -k -d testrelm.test -h `hostname` hosts.byname
nkhost1.testrelm.test 192.168.4.5 nkhost1.testrelm.test

# getent -s nis hosts
192.168.4.5     nkhost1.testrelm.test

Comment 6 errata-xmlrpc 2015-03-05 10:26:09 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://rhn.redhat.com/errata/RHBA-2015-0445.html


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