Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2181705

Summary: 'getent' ignores netgroups in /etc/passwd when listing users with passwd_compat in RHEL 8
Product: Red Hat Enterprise Linux 8 Reporter: Akshay Sakure <asakure>
Component: glibcAssignee: glibc team <glibc-bugzilla>
Status: CLOSED MIGRATED QA Contact: qe-baseos-tools-bugs
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.7CC: ashankar, codonell, dj, fweimer, pfrankli, sipoyare
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-22 15:16:02 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:

Description Akshay Sakure 2023-03-25 07:33:36 UTC
Description of problem:
'getent' ignores netgroups in /etc/passwd when listing users with passwd_compat in RHEL8


Version-Release number of selected component (if applicable):
RHEL 8.7
glibc-2.28-211.el8.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Configure RHEL 8.7 as NIS client

2. Configure 'compat' mode in /etc/nsswitch.conf:
---
passwd: compat
group: compat
shadow: files
netgroup: files nis
---

3. Add netgroup entries at the bottom of /etc/passwd file:
---
+@netgroup1::0:0:::
+@netgroup2::0:0:::
---

4. Run 'getent passwd' command, it doesn't show list of users which are part of netgroups mentioned in /etc/passwd file. Only local users list is displayed, users in the netgroup don't get enumerated.

Actual results:
Only the local users from /etc/passwd get listed. Users in the netgroup don't get enumerated.


Expected results:
Users in the netgroup should be listed too.


Additional info:
Similar setup seems to be working just fine in RHEL 7glibc-2.28-211.el8.x86_64

Comment 4 Carlos O'Donell 2023-04-03 16:26:27 UTC
(In reply to Akshay Sakure from comment #0)
> Description of problem:
> 'getent' ignores netgroups in /etc/passwd when listing users with
> passwd_compat in RHEL8

Yes, this should work just like it does in RHEL7.

Please note that the glibc package no longer provides the NSS NIS plugin that is needed by "compat" support.

Have you installed the required "nss_nis" package to provide the new IPv4/IPv6-enabled TIRPC-based NIS client support?

Comment 5 Florian Weimer 2023-04-03 16:50:47 UTC
I think strace shows that nss_nis is being loaded, so that can't be it.

I'm afraid we'll need access to a reproduction environment to track this one down. Akshay, would you be able to provide us with access to an environment? Thanks.

Comment 6 Akshay Sakure 2023-04-07 18:14:20 UTC
Florian, allow me a couple of days, let me try build a reproducer environment so that you can have access to it.

Comment 16 Carlos O'Donell 2023-07-24 18:52:46 UTC
Development has reviewed this issue and while we are able to reproduce problems that resemble the customers problems, we are also able to correct those issues by using standard NIS tooling as intended.

Developer notes are as follows:
~~~
I was able to reproduce this on my local system.  However, I was also
able to fix it using YP tools as in my case it was a misconfigured YP
server that caused this problem.  I'll go over what I found here, in
case you're having the same problem.

First, I found that a "ypset -ypsetme" was required on both server and
host before any NIS commands would succeed.  This is not covered in
most public NIS configuration docs.

Second, I had to remember to run "make" in /var/yp *and* restart the
ypserv service after editing /etc/passwd on the server.

My tests:

serv7$  getent passwd
(shows all entries)

client8$  getent passwd
(netgroup entries missing)

client8$ ypcat passwd
(shows all entries)

client8$ ypmatch nisuser3 passwd
(no entry returned!)

serv7$ ypmatch nisuser3 passwd
(none here either?)

This is where I rebuild the YP maps and restarted the YP server.

serv7$ ypmatch nisuser3 passwd
(shows entry)

client8$ ypmatch nisuser3 passwd
(shows entry)

client8$  getent passwd
(netgroup entries present)

In summary, "getent passwd" does not use "ypcat passwd"; it reads the
netgroups from the YP server and then uses passwd.byname to fill in
each entry.  So, please use ypmatch to verify that passwd.byname is
working.
~~~

Please tell us if this helps you resolve your issues.

If this doesn't resolve your issue then we will need more information about your configuration.

Comment 20 RHEL Program Management 2023-09-22 15:14:48 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 21 RHEL Program Management 2023-09-22 15:16:02 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.