Bug 2149979

Summary: Adding NIS user to local group. Secondary NIS groups are missing.
Product: Red Hat Enterprise Linux 8 Reporter: Eugene Keck <ekeck>
Component: ypbindAssignee: Ondřej Sloup <osloup>
Status: NEW --- QA Contact: Vaclav Danek <vdanek>
Severity: high Docs Contact:
Priority: high    
Version: 8.6CC: databases-maint, hhorak, mmuzila, rhel-cs-apps-subsystem-qe, vdanek
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 Eugene Keck 2022-12-01 14:02:11 UTC
Description of problem:
Adding NIS user to local group. Secondary NIS groups are missing.

Version-Release number of selected component (if applicable):
ypbind-2.5-2.el8

How reproducible:
Always

Steps to Reproduce:
1. usermod -a -G localgroup testuser

Actual results:
uid=1000(testuser) gid=1000(testuser) groups=1000(testuser),9999(localgroup)

Expected results:
uid=1000(testuser) gid=1000(testuser) groups=1000(testuser),1001(group1),1002(group2),1003(group3),1004(group4),9999(localgroup)

Additional info:
[root@rhel8 ~]# grep testuser /etc/passwd
[root@rhel8 ~]#

[root@rhel8 ~]# grep localgroup /etc/group
localgroup:x:9999:

[root@rhel8 ~]# ypcat passwd
testuser:!!:1000:1000::/home/testuser:/bin/bash

[root@rhel8 ~]# ypcat group
group1:!:1001:testuser
group2:!:1002:testuser
group3:!:1003:testuser
group4:!:1004:testuser
testuser:!:1000:

[root@rhel8 ~]# id testuser
uid=1000(testuser) gid=1000(testuser) groups=1000(testuser),1001(group1),1002(group2),1003(group3),1004(group4)

[root@rhel8 ~]# usermod -a -G localgroup testuser

[root@rhel8 ~]# id testuser
uid=1000(testuser) gid=1000(testuser) groups=1000(testuser),9999(localgroup)

It dose work if nscd is started

[root@rhel8 ~]# service nscd start
Redirecting to /bin/systemctl start nscd.service

[root@rhel8 ~]# id testuser
uid=1000(testuser) gid=1000(testuser) groups=9999(localgroup),1001(group1),1002(group2),1003(group3),1004(group4),1000(testuser)