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

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