From a55661d60c1e1689c51aa15a483176d27d0ff85b Mon Sep 17 00:00:00 2001 From: Packit Bot Date: May 04 2021 22:13:45 +0000 Subject: Apply patch autofs-5.1.7-cleanup-cache_delete-a-little.patch patch_name: autofs-5.1.7-cleanup-cache_delete-a-little.patch present_in_specfile: true --- diff --git a/CHANGELOG b/CHANGELOG index 156b740..c4643d6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -23,6 +23,7 @@ - eliminate some strlen calls in offset handling. - don't add offset mounts to mounted mounts table. - reduce umount EBUSY check delay. +- cleanup cache_delete() a little. xx/xx/2018 autofs-5.1.5 - fix flag file permission. diff --git a/lib/cache.c b/lib/cache.c index bdcb046..6f29223 100644 --- a/lib/cache.c +++ b/lib/cache.c @@ -887,20 +887,15 @@ int cache_delete(struct mapent_cache *mc, const char *key) struct mapent *me = NULL, *pred; u_int32_t hashval = hash(key, mc->size); int ret = CHE_OK; - char this[PATH_MAX]; - - strcpy(this, key); me = mc->hash[hashval]; - if (!me) { - ret = CHE_FAIL; + if (!me) goto done; - } while (me->next != NULL) { pred = me; me = me->next; - if (strcmp(this, me->key) == 0) { + if (strcmp(key, me->key) == 0) { struct stack *s = me->stack; if (me->multi && !list_empty(&me->multi_list)) { ret = CHE_FAIL; @@ -929,7 +924,7 @@ int cache_delete(struct mapent_cache *mc, const char *key) if (!me) goto done; - if (strcmp(this, me->key) == 0) { + if (strcmp(key, me->key) == 0) { struct stack *s = me->stack; if (me->multi && !list_empty(&me->multi_list)) { ret = CHE_FAIL;