From 08c72b84d85d482f030a30cf74786695f097e91c Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Sat, 15 Dec 2012 13:23:09 +0100 Subject: 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. --- src/responder/autofs/autofssrv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/responder/autofs/autofssrv.c') 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")); -- cgit