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

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