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

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