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

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