autofs-5.0.9 - dont add wildcard to negative cache From: Ian Kent If the wilcard is added to the negative cache it prevents any further matching of the wildcard for the given map. --- CHANGELOG | 1 + daemon/lookup.c | 4 ++++ lib/cache.c | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 572f9a7..825e53a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -22,6 +22,7 @@ - fix typo in update_hosts_mounts(). - make negative cache update consistent for all lookup modules. - ensure negative cache isn't updated on remount. +- dont add wildcard to negative cache. 28/03/2014 autofs-5.0.9 ======================= diff --git a/daemon/lookup.c b/daemon/lookup.c index f0faf37..f51ae94 100644 --- a/daemon/lookup.c +++ b/daemon/lookup.c @@ -940,6 +940,10 @@ static void update_negative_cache(struct autofs_point *ap, struct map_source *so if (source && source->depth) return; + /* Don't update the wildcard */ + if (strlen(name) == 1 && *name == '*') + return; + /* Have we recorded the lookup fail for negative caching? */ me = lookup_source_mapent(ap, name, LKP_DISTINCT); if (me) diff --git a/lib/cache.c b/lib/cache.c index f2efcd3..098352b 100644 --- a/lib/cache.c +++ b/lib/cache.c @@ -753,6 +753,10 @@ void cache_update_negative(struct mapent_cache *mc, struct mapent *me; int rv = CHE_OK; + /* Don't update the wildcard */ + if (strlen(key) == 1 && *key == '*') + return; + me = cache_lookup_distinct(mc, key); if (me) rv = cache_push_mapent(me, NULL);