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

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