autofs-5.0.9 - fix fix negative status being reset on map read

From: Ian Kent <ikent@redhat.com>

The original patch to fix the negative status being reset on map
read caused a regression for the case where a negative entry was
created as a result of a lookup matching the wildcard entry.

It isn't possible to eliminate the key not found in map messages
on map read for this case because there's no way of knowing if
a map change would have fixed the original problem so the negative
entry status must be reset and the mount retried on each map read.
---
 CHANGELOG       |    1 +
 daemon/lookup.c |    5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 8cdee0a..87c07b3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,6 +4,7 @@
 - add amd map format parser.
 - check for non existent negative entries in lookup_ghost().
 - fix reset flex scan buffer on init.
+- fix fix negative status being reset on map read.
 
 28/03/2014 autofs-5.0.9
 =======================
diff --git a/daemon/lookup.c b/daemon/lookup.c
index 9f96830..1761f7e 100644
--- a/daemon/lookup.c
+++ b/daemon/lookup.c
@@ -1285,8 +1285,11 @@ void lookup_prune_one_cache(struct autofs_point *ap, struct mapent_cache *mc, ti
 			/*
 			 * Reset time of last fail for valid map entries to
 			 * force entry update and subsequent mount retry.
+			 * A map entry that's still invalid after a read
+			 * may have been created by a failed wildcard lookup
+			 * so reset the status on those too.
 			 */
-			if (me->mapent)
+			if (me->mapent || cache_lookup(mc, "*"))
 				me->status = 0;
 			me = cache_enumerate(mc, me);
 			continue;
