summaryrefslogtreecommitdiffstats
path: root/src/responder/nss/nsssrv.c
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-07-29 14:45:35 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-08-08 11:13:41 +0200
commit6eb816852316f878e5c7aaac9b4ec7578621852a (patch)
tree4af76746c85cab9c4e42232e8a2016fd2bd4c858 /src/responder/nss/nsssrv.c
parent2f23a9ced7b8f208e58aacc6689eff362c38db1e (diff)
downloadsssd-6eb816852316f878e5c7aaac9b4ec7578621852a.tar.gz
sssd-6eb816852316f878e5c7aaac9b4ec7578621852a.tar.xz
sssd-6eb816852316f878e5c7aaac9b4ec7578621852a.zip
NSS: allow removing entries from netgroup hash table
There is a timed desctructor in the nss responder that, when the entry timeout passes, removes the netgroup from the hash table while the netgroup is freed. This patch adds a hash delete callback so that if the netgroup is removed from the hash table with hash_delete, its hash table pointer will be invalidated. Later, when the entry is being freed, the destructor won't attempt to remove it from the hash table.
Diffstat (limited to 'src/responder/nss/nsssrv.c')
-rw-r--r--src/responder/nss/nsssrv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/responder/nss/nsssrv.c b/src/responder/nss/nsssrv.c
index 17a59b19a..c6ff4f178 100644
--- a/src/responder/nss/nsssrv.c
+++ b/src/responder/nss/nsssrv.c
@@ -35,6 +35,7 @@
#include "responder/nss/nsssrv.h"
#include "responder/nss/nsssrv_private.h"
#include "responder/nss/nsssrv_mmap_cache.h"
+#include "responder/nss/nsssrv_netgroup.h"
#include "responder/common/negcache.h"
#include "db/sysdb.h"
#include "confdb/confdb.h"
@@ -453,7 +454,8 @@ int nss_process_init(TALLOC_CTX *mem_ctx,
}
/* Create the lookup table for netgroup results */
- hret = sss_hash_create(nctx, 10, &nctx->netgroups);
+ hret = sss_hash_create_ex(nctx, 10, &nctx->netgroups, 0, 0, 0, 0,
+ netgroup_hash_delete_cb, NULL);
if (hret != HASH_SUCCESS) {
DEBUG(0,("Unable to initialize netgroup hash table\n"));
return EIO;