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 1457927

Summary: getent failed to fetch netgroup information after changing default_domain_suffix to ADdomin in /etc/sssd/sssd.conf
Product: Red Hat Enterprise Linux 7 Reporter: Varun Mylaraiah <mvarun>
Component: sssdAssignee: SSSD Maintainers <sssd-maint>
Status: CLOSED ERRATA QA Contact: Varun Mylaraiah <mvarun>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: grajaiya, ipa-qe, jhrozek, lmiksik, lslebodn, mkosek, mvarun, mzidek, pbrezina, sgoveas, tscherf
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: sssd-1.15.2-45.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 09:06:23 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 Varun Mylaraiah 2017-06-01 14:31:26 UTC
Description of problem:
getent failed to fetch netgroup information after changing default_domain_suffix to ADdomin in /etc/sssd/sssd.conf

Version-Release number of selected component (if applicable):
sssd-1.15.2-37.el7.x86_64
ipa-server-4.5.0-13.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
Description of problem:
getent failed to fetch netgroup information after changing default_domain_suffix to ADdomin in /etc/sssd/sssd.conf


:: [  BEGIN   ] :: Running 'kdestroy -A'
:: [   PASS   ] :: Command 'kdestroy -A' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'echo Secret123|kinit admin'
Password for admin:
:: [   PASS   ] :: Command 'echo Secret123|kinit admin' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa netgroup-add --desc test_netgroup ng_test'
------------------------
Added netgroup "ng_test"
------------------------
  Netgroup name: ng_test
  Description: test_netgroup
  NIS domain name: sudoexsm37.test
  IPA unique ID: defa9578-45da-11e7-b3eb-5254007eedd6
:: [   PASS   ] :: Command 'ipa netgroup-add --desc test_netgroup ng_test' (Expected 0, got 0)

:: [  BEGIN   ] :: Running 'awk '/\[sssd\]/,/^$/' /etc/sssd/sssd.conf'
[sssd]
default_domain_suffix = pne.qe
debug_level = 10
services = nss, pam, ssh, sudo
 
:: [   PASS   ] :: Command 'awk '/\[sssd\]/,/^$/' /etc/sssd/sssd.conf' (Expected 0, got 0)

:: [  BEGIN   ] :: Running 'service sssd stop; rm -rf /var/lib/sss/{db,mc}/*; service sssd start'
Redirecting to /bin/systemctl stop sssd.service
Redirecting to /bin/systemctl start sssd.service
:: [   PASS   ] :: Command 'service sssd stop; rm -rf /var/lib/sss/{db,mc}/*; service sssd start' (Expected 0, got 0)

:: [  BEGIN   ] :: Running 'getent netgroup ng_test > ipa_trust_func_bug_1127757.rlkQ8B 2>&1'
:: [   FAIL   ] :: Command 'getent netgroup ng_test > ipa_trust_func_bug_1127757.rlkQ8B 2>&1' (Expected 0, got 2)
:: [   FAIL   ] :: File 'ipa_trust_func_bug_1127757.rlkQ8B' should contain 'ipauser1'

:: [   FAIL   ] :: File '/var/log/sssd/sssd_nss.log' should contain 'sss_dp_issue_request.*ng_test'



Expected results:
netgroups shouldn't be affected by default domain suffix

Additional info:

getting the expected result by adding IPAdomain with netgroup (getent netgroup <netgroupname@IPADOMAIN>)
# getent netgroup ng_test
ng_test (-,ipauser1,sudoexsm37.test)

Old bug https://bugzilla.redhat.com/show_bug.cgi?id=1312275 with the same kind of issue was verified in Rhle 6.5 and sssd-1.11.6-20.el6

Comment 3 Lukas Slebodnik 2017-06-08 10:28:28 UTC
Upstream ticket:
https://pagure.io/SSSD/sssd/issue/3428

Comment 4 Jakub Hrozek 2017-06-08 15:38:14 UTC
* master: c83e265bbb5b2f2aa4f0067263753c8403c383f

Comment 6 Varun Mylaraiah 2017-06-09 10:37:45 UTC
# rpm -qa sssd
sssd-1.15.2-45.el7.x86_64

# kdestroy -A

# echo <xxxxx>|kinit admin

# ipa netgroup-add --desc test_netgroup ng_test
------------------------
Added netgroup "ng_test"
------------------------
  Netgroup name: ng_test
  Description: test_netgroup
  NIS domain name: hbacexwl2.test
  IPA unique ID: 9f016e9a-4cfd-11e7-af71-5254003e24f5

# awk '/\[sssd\]/,/^$/' /etc/sssd/sssd.conf
[sssd]
default_domain_suffix = ipaad2012r2.test
debug_level = 10
services = sudo, nss, ifp, pam, ssh, sudo

# service sssd stop; rm -rf /var/lib/sss/{db,mc}/*; service sssd startRedirecting to /bin/systemctl stop sssd.service
Redirecting to /bin/systemctl start sssd.service

# getent netgroup ng_test
ng_test              

Expected results:
ng_test (-,ipauser1,hbacexwl2.test)

Comment 7 Jakub Hrozek 2017-06-12 14:18:34 UTC
(In reply to Varun Mylaraiah from comment #6)
> # rpm -qa sssd
> sssd-1.15.2-45.el7.x86_64
> 
> # kdestroy -A
> 
> # echo <xxxxx>|kinit admin
> 
> # ipa netgroup-add --desc test_netgroup ng_test
> ------------------------
> Added netgroup "ng_test"
> ------------------------
>   Netgroup name: ng_test
>   Description: test_netgroup
>   NIS domain name: hbacexwl2.test
>   IPA unique ID: 9f016e9a-4cfd-11e7-af71-5254003e24f5
> 
> # awk '/\[sssd\]/,/^$/' /etc/sssd/sssd.conf
> [sssd]
> default_domain_suffix = ipaad2012r2.test
> debug_level = 10
> services = sudo, nss, ifp, pam, ssh, sudo
> 
> # service sssd stop; rm -rf /var/lib/sss/{db,mc}/*; service sssd
> startRedirecting to /bin/systemctl stop sssd.service
> Redirecting to /bin/systemctl start sssd.service
> 
> # getent netgroup ng_test
> ng_test              
> 
> Expected results:
> ng_test (-,ipauser1,hbacexwl2.test)

I'm sorry, but this comment doesn't let me debug the issue properly.

It doesn't show that you actually added users or groups to the netgroup, there are no logs or access to a reproducer system. This case also works for me well.

Please, add useful data to bug comments in the future..

Comment 8 Varun Mylaraiah 2017-06-13 08:10:34 UTC
Got expected result:-

:: [  BEGIN   ] :: Running 'sed -i "/\[sssd\]/ a default_domain_suffix = ipaad2012r2.test" /etc/sssd/sssd.conf'
:: [   PASS   ] :: Command 'sed -i "/\[sssd\]/ a default_domain_suffix = ipaad2012r2.test" /etc/sssd/sssd.conf' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'awk '/\[sssd\]/,/^$/' /etc/sssd/sssd.conf'
[sssd]
default_domain_suffix = ipaad2012r2.test
debug_level = 10
services = nss, pam, ssh, sudo

:: [   PASS   ] :: Command 'awk '/\[sssd\]/,/^$/' /etc/sssd/sssd.conf' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'awk '/\[nss\]/,/^$/' /etc/sssd/sssd.conf | tee ipa_trust_func_bug_1127757.ud8rT8'
[nss]
debug_level = 10
homedir_substring = /home

:: [   PASS   ] :: Command 'awk '/\[nss\]/,/^$/' /etc/sssd/sssd.conf | tee ipa_trust_func_bug_1127757.ud8rT8' (Expected 0, got 0)
debug_level = 10
:: [  BEGIN   ] :: Running 'service sssd stop; rm -rf /var/lib/sss/{db,mc}/*; service sssd start'
Redirecting to /bin/systemctl stop sssd.service
Redirecting to /bin/systemctl start sssd.service
:: [   PASS   ] :: Command 'service sssd stop; rm -rf /var/lib/sss/{db,mc}/*; service sssd start' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'getent netgroup ng_test > ipa_trust_func_bug_1127757.ud8rT8 2>&1'
:: [   PASS   ] :: Command 'getent netgroup ng_test > ipa_trust_func_bug_1127757.ud8rT8 2>&1' (Expected 0, got 0)
:: [   PASS   ] :: File 'ipa_trust_func_bug_1127757.ud8rT8' should contain 'ipauser1' 
:: [   PASS   ] :: File '/var/log/sssd/sssd_nss.log' should contain 'sss_dp_issue_request.*ng_test' 
:: [   PASS   ] :: Restore /etc/sssd/sssd.conf 
:: [  BEGIN   ] :: Running 'service sssd stop; rm -rf /var/lib/sss/{db,mc}/*; service sssd start'
Redirecting to /bin/systemctl stop sssd.service
Redirecting to /bin/systemctl start sssd.service
:: [   PASS   ] :: Command 'service sssd stop; rm -rf /var/lib/sss/{db,mc}/*; service sssd start' (Expected 0, got 0)

# rpm -qa sssd
sssd-1.15.2-45.el7.x86_64

Comment 9 errata-xmlrpc 2017-08-01 09:06:23 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/RHEA-2017:2294