Red Hat Bugzilla – Bug 986379
sss_cache -N/-n should invalidate the hash table in sssd_nss
Last modified: 2014-06-18 03:09:03 EDT
+++ This bug was initially created as a clone of Bug #896558 +++ This bug is created as a clone of upstream ticket: https://fedorahosted.org/sssd/ticket/1759 sss_cache only invalidates the ldb records, but not the in-memory cache that holds the netgroup record. We need to fix that otherwise sssd returns non-logical results: getent netgroup netgr -> shows netgroup, expected (remove netgroup from LDAP) sss_cache -N getent netgroup netgr -> still shows the netgroup, should not
A little explanation on why some special casing is needed: For various reasons (speed, concurrent access, peculiarities of the netgroups GLIBC API), there is yet another caching layer in the NSS responder in a form of hash table. This hash table predates the fast memcache added in 6.4. Currently, all that sss_cache does is invalidate the cache on disk, but it doesn't invalidate entries in the hash table. That's the purpose of this fix.
Fixed upstream.
with sssd-1.9.2-127.el6.x86_64 [root@dhcp207-156 ~]# getent netgroup netgrp netgrp (machine2.example.com, , example.com) (machine1.example.com, , example.com) Removed netgroup from DS. [root@dhcp207-156 ~]# sss_cache -N [root@dhcp207-156 ~]# getent netgroup netgrp netgrp [root@dhcp207-156 ~]# echo $? 0 For non-existing netgroup. [root@dhcp207-156 ~]# getent netgroup ttt [root@dhcp207-156 ~]# echo $? 2
Niru, according to Pavel's investigation, you actually hit another bug planned for 6.6 during your testing. Pavel amended the test and it should pass now. Is it the case?
Hi Jakub, Yup, after fixing the testcase its passing now. Thanks, Niru
From beaker automation output : -------------------------------------------------------------------- adding new entry "cn=netgrp,ou=Netgroups,dc=example,dc=com" Stopping sssd: [ OK ] Starting sssd: [ OK ] [ OK ] netgrp :: [ PASS ] :: Running 'getent netgroup netgrp | grep netgrp' (Expected 0, got 0) ldap_initialize( ldap://kvm-guest-03.rhts.eng.bos.redhat.com ) deleting entry "cn=netgrp,ou=Netgroups,dc=example,dc=com" :: [ PASS ] :: Running 'getent netgroup netgrp' (Expected 2, got 2) ----------------------------------------------------------------------
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. http://rhn.redhat.com/errata/RHBA-2013-1680.html