Blame SOURCES/autofs-5.1.1-fix-out-of-order-call-in-program-map-lookup.patch

304803
autofs-5.1.1 - fix out of order call in program map lookup
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
Commit 91e42e58b4 fixed a problem with program map environment variable
304803
naming and commit 743deb0e4e added a configuration option to force use
304803
of the old environment names for those who need it and are sure it is
304803
safe to continue to use them.
304803
304803
But the call to get the configuration entry was placed after a fork()
304803
so the state of the mutex used when querying the configuration is
304803
undefined and can lead to a deadlock.
304803
304803
Signed-off-by: Ian Kent <raven@themaw.net>
304803
---
304803
 CHANGELOG                |    1 +
304803
 modules/lookup_program.c |   20 ++++++++++----------
304803
 2 files changed, 11 insertions(+), 10 deletions(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -181,6 +181,7 @@
304803
 - fix direct mount stale instance flag reset.
304803
 - fix direct map expire not set for initail empty map.
304803
 - update map_hash_table_size description.
304803
+- fix out of order call in program map lookup.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/modules/lookup_program.c
304803
+++ autofs-5.0.7/modules/lookup_program.c
304803
@@ -139,6 +139,16 @@ static char *lookup_one(struct autofs_po
304803
 	}
304803
 
304803
 	/*
304803
+	 * By default use a prefix with standard environment
304803
+	 * variables to prevent system subversion by interpreted
304803
+	 * languages.
304803
+	 */
304803
+	if (defaults_force_std_prog_map_env())
304803
+		prefix = NULL;
304803
+	else
304803
+		prefix = "AUTOFS_";
304803
+
304803
+	/*
304803
 	 * We don't use popen because we don't want to run /bin/sh plus we
304803
 	 * want to send stderr to the syslog, and we don't use spawnl()
304803
 	 * because we need the pipe hooks
304803
@@ -177,16 +187,6 @@ static char *lookup_one(struct autofs_po
304803
 			     ap->path, ctxt->mapname);
304803
 
304803
 		/*
304803
-		 * By default use a prefix with standard environment
304803
-		 * variables to prevent system subversion by interpreted
304803
-		 * languages.
304803
-		 */
304803
-		if (defaults_force_std_prog_map_env())
304803
-			prefix = NULL;
304803
-		else
304803
-			prefix = "AUTOFS_";
304803
-
304803
-		/*
304803
 		 * MAPFMT_DEFAULT must be "sun" for ->parse_init() to have setup
304803
 		 * the macro table.
304803
 		 */