Blame SOURCES/autofs-5.1.0-dont-add-wildcard-to-negative-cache.patch

516ab0
autofs-5.1.0 - dont add wildcard to negative cache
516ab0
516ab0
From: Ian Kent <ikent@redhat.com>
516ab0
516ab0
If the wilcard is added to the negative cache it prevents any
516ab0
further matching of the wildcard for the given map.
516ab0
---
516ab0
 CHANGELOG       |    1 +
516ab0
 daemon/lookup.c |    4 ++++
516ab0
 lib/cache.c     |    4 ++++
516ab0
 3 files changed, 9 insertions(+)
516ab0
516ab0
--- autofs-5.0.7.orig/CHANGELOG
516ab0
+++ autofs-5.0.7/CHANGELOG
516ab0
@@ -161,6 +161,7 @@
516ab0
 - fix hosts map update on reload.
516ab0
 - make negative cache update consistent for all lookup modules.
516ab0
 - ensure negative cache isn't updated on remount.
516ab0
+- dont add wildcard to negative cache.
516ab0
 
516ab0
 25/07/2012 autofs-5.0.7
516ab0
 =======================
516ab0
--- autofs-5.0.7.orig/daemon/lookup.c
516ab0
+++ autofs-5.0.7/daemon/lookup.c
516ab0
@@ -1057,6 +1057,10 @@ static void update_negative_cache(struct
516ab0
 	if (source && source->depth)
516ab0
 		return;
516ab0
 
516ab0
+	/* Don't update the wildcard */
516ab0
+	if (strlen(name) == 1 && *name == '*')
516ab0
+		return;
516ab0
+
516ab0
 	/* Have we recorded the lookup fail for negative caching? */
516ab0
 	me = lookup_source_mapent(ap, name, LKP_DISTINCT);
516ab0
 	if (me)
516ab0
--- autofs-5.0.7.orig/lib/cache.c
516ab0
+++ autofs-5.0.7/lib/cache.c
516ab0
@@ -762,6 +762,10 @@ void cache_update_negative(struct mapent
516ab0
 	struct mapent *me;
516ab0
 	int rv = CHE_OK;
516ab0
 
516ab0
+	/* Don't update the wildcard */
516ab0
+	if (strlen(key) == 1 && *key == '*')
516ab0
+		return;
516ab0
+
516ab0
 	me = cache_lookup_distinct(mc, key);
516ab0
 	if (me)
516ab0
 		rv = cache_push_mapent(me, NULL);