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

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