Blame SOURCES/autofs-5.0.8-fix-cache-readlock-not-taken-on-lookup.patch

304803
autofs-5.0.8 - fix cache readlock not taken on lookup
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
In modules/lookup_yp.c:check_map_indirect() there's a missing cache
304803
readlock.
304803
---
304803
 CHANGELOG           |    1 +
304803
 modules/lookup_yp.c |    6 +++++-
304803
 2 files changed, 6 insertions(+), 1 deletion(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -81,6 +81,7 @@
304803
 - fix symlink fail message in mount_bind.c.
304803
 - add std vars to program map invocation.
304803
 - check for existing offset mount before mounting.
304803
+- fix cache readlock not taken on lookup.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/modules/lookup_yp.c
304803
+++ autofs-5.0.7/modules/lookup_yp.c
304803
@@ -517,9 +517,13 @@ static int check_map_indirect(struct aut
304803
 		 * If the server is down and the entry exists in the cache
304803
 		 * and belongs to this map return success and use the entry.
304803
 		 */
304803
+		cache_readlock(mc);
304803
 		exists = cache_lookup(mc, key);
304803
-		if (exists && exists->source == source)
304803
+		if (exists && exists->source == source) {
304803
+			cache_unlock(mc);
304803
 			return NSS_STATUS_SUCCESS;
304803
+		}
304803
+		cache_unlock(mc);
304803
 
304803
 		warn(ap->logopt,
304803
 		     MODPREFIX "lookup for %s failed: %s",