diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-12-15 13:23:09 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-12-18 17:25:34 +0100 |
commit | 08c72b84d85d482f030a30cf74786695f097e91c (patch) | |
tree | b86b9e4f70d31859377ab267d23cf088387b6ef3 /src/responder/autofs/autofssrv.c | |
parent | 06cb67c391dd8c2b1542a7d87fb5568fdad448cb (diff) | |
download | sssd-08c72b84d85d482f030a30cf74786695f097e91c.tar.gz sssd-08c72b84d85d482f030a30cf74786695f097e91c.tar.bz2 sssd-08c72b84d85d482f030a30cf74786695f097e91c.zip |
AUTOFS: allow removing entries from hash table
There is a timed desctructor in the autofs responder that, when the
entry timeout passes, removes the autofs map from the hash table while
the map is freed. This patch adds a hash delete callback so that if the
map 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/autofs/autofssrv.c')
-rw-r--r-- | src/responder/autofs/autofssrv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/responder/autofs/autofssrv.c b/src/responder/autofs/autofssrv.c index 86a816a3..d7c10d6c 100644 --- a/src/responder/autofs/autofssrv.c +++ b/src/responder/autofs/autofssrv.c @@ -158,7 +158,8 @@ autofs_process_init(TALLOC_CTX *mem_ctx, } /* Create the lookup table for setautomntent results */ - hret = sss_hash_create(autofs_ctx, 10, &autofs_ctx->maps); + hret = sss_hash_create_ex(autofs_ctx, 10, &autofs_ctx->maps, 0, 0, 0, 0, + autofs_map_hash_delete_cb, NULL); if (hret != HASH_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to initialize automount maps hash table\n")); |