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

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