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

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