Blame SOURCES/autofs-5.1.8-fix-parse-module-instance-mutex-naming.patch

5a83b1
autofs-5.1.8 - fix parse module instance mutex naming
5a83b1
5a83b1
From: Ian Kent <raven@themaw.net>
5a83b1
5a83b1
The naming used for parse module instance locks is the same as that
5a83b1
used for map lookup instances. Rename these to make it clear they
5a83b1
are being used in the parse modules.
5a83b1
5a83b1
Signed-off-by: Ian Kent <raven@themaw.net>
5a83b1
---
5a83b1
 CHANGELOG           |    1 +
5a83b1
 modules/parse_amd.c |   28 ++++++++++++++--------------
5a83b1
 modules/parse_sun.c |   20 ++++++++++----------
5a83b1
 3 files changed, 25 insertions(+), 24 deletions(-)
5a83b1
5a83b1
--- autofs-5.1.7.orig/CHANGELOG
5a83b1
+++ autofs-5.1.7/CHANGELOG
5a83b1
@@ -104,6 +104,7 @@
5a83b1
 - dont use initgroups() at spawn.
5a83b1
 - fix invalid tsv access.
5a83b1
 - fix missing unlock in sasl_do_kinit_ext_cc().
5a83b1
+- fix parse module instance mutex naming.
5a83b1
 
5a83b1
 25/01/2021 autofs-5.1.7
5a83b1
 - make bind mounts propagation slave by default.
5a83b1
--- autofs-5.1.7.orig/modules/parse_amd.c
5a83b1
+++ autofs-5.1.7/modules/parse_amd.c
5a83b1
@@ -39,18 +39,18 @@ int parse_version = AUTOFS_PARSE_VERSION
5a83b1
 
5a83b1
 static struct mount_mod *mount_nfs = NULL;
5a83b1
 static int init_ctr = 0;
5a83b1
-static pthread_mutex_t instance_mutex = PTHREAD_MUTEX_INITIALIZER;
5a83b1
+static pthread_mutex_t parse_instance_mutex = PTHREAD_MUTEX_INITIALIZER;
5a83b1
 
5a83b1
-static void instance_mutex_lock(void)
5a83b1
+static void parse_instance_mutex_lock(void)
5a83b1
 {
5a83b1
-	int status = pthread_mutex_lock(&instance_mutex);
5a83b1
+	int status = pthread_mutex_lock(&parse_instance_mutex);
5a83b1
 	if (status)
5a83b1
 		fatal(status);
5a83b1
 }
5a83b1
 
5a83b1
-static void instance_mutex_unlock(void)
5a83b1
+static void parse_instance_mutex_unlock(void)
5a83b1
 {
5a83b1
-	int status = pthread_mutex_unlock(&instance_mutex);
5a83b1
+	int status = pthread_mutex_unlock(&parse_instance_mutex);
5a83b1
 	if (status)
5a83b1
 		fatal(status);
5a83b1
 }
5a83b1
@@ -112,7 +112,7 @@ int parse_init(int argc, const char *con
5a83b1
 
5a83b1
 	/* We only need this once.  NFS mounts are so common that we cache
5a83b1
 	   this module. */
5a83b1
-	instance_mutex_lock();
5a83b1
+	parse_instance_mutex_lock();
5a83b1
 	if (mount_nfs)
5a83b1
 		init_ctr++;
5a83b1
 	else {
5a83b1
@@ -121,11 +121,11 @@ int parse_init(int argc, const char *con
5a83b1
 		} else {
5a83b1
 			kill_context(ctxt);
5a83b1
 			*context = NULL;
5a83b1
-			instance_mutex_unlock();
5a83b1
+			parse_instance_mutex_unlock();
5a83b1
 			return 1;
5a83b1
 		}
5a83b1
 	}
5a83b1
-	instance_mutex_unlock();
5a83b1
+	parse_instance_mutex_unlock();
5a83b1
 
5a83b1
 	return 0;
5a83b1
 }
5a83b1
@@ -1358,11 +1358,11 @@ static int do_host_mount(struct autofs_p
5a83b1
 		argc = 1;
5a83b1
 	}
5a83b1
 
5a83b1
-	instance_mutex_lock();
5a83b1
+	parse_instance_mutex_lock();
5a83b1
 	status = open_lookup("hosts", MODPREFIX, NULL, argc, pargv, &lookup);
5a83b1
 	if (status != NSS_STATUS_SUCCESS) {
5a83b1
 		debug(ap->logopt, "open lookup module hosts failed");
5a83b1
-		instance_mutex_unlock();
5a83b1
+		parse_instance_mutex_unlock();
5a83b1
 		goto out;
5a83b1
 	}
5a83b1
 
5a83b1
@@ -1374,13 +1374,13 @@ static int do_host_mount(struct autofs_p
5a83b1
 		if (!instance) {
5a83b1
 			error(ap->logopt, MODPREFIX
5a83b1
 			     "failed to create source instance for hosts map");
5a83b1
-			instance_mutex_unlock();
5a83b1
+			parse_instance_mutex_unlock();
5a83b1
 			close_lookup(lookup);
5a83b1
 			goto out;
5a83b1
 		}
5a83b1
 	}
5a83b1
 	instance->lookup = lookup;
5a83b1
-	instance_mutex_unlock();
5a83b1
+	parse_instance_mutex_unlock();
5a83b1
 
5a83b1
 	cache_writelock(source->mc);
5a83b1
 	me = cache_lookup_distinct(source->mc, name);
5a83b1
@@ -2373,12 +2373,12 @@ int parse_done(void *context)
5a83b1
 	int rv = 0;
5a83b1
 	struct parse_context *ctxt = (struct parse_context *) context;
5a83b1
 
5a83b1
-	instance_mutex_lock();
5a83b1
+	parse_instance_mutex_lock();
5a83b1
 	if (--init_ctr == 0) {
5a83b1
 		rv = close_mount(mount_nfs);
5a83b1
 		mount_nfs = NULL;
5a83b1
 	}
5a83b1
-	instance_mutex_unlock();
5a83b1
+	parse_instance_mutex_unlock();
5a83b1
 	if (ctxt)
5a83b1
 		kill_context(ctxt);
5a83b1
 
5a83b1
--- autofs-5.1.7.orig/modules/parse_sun.c
5a83b1
+++ autofs-5.1.7/modules/parse_sun.c
5a83b1
@@ -41,18 +41,18 @@ int parse_version = AUTOFS_PARSE_VERSION
5a83b1
 
5a83b1
 static struct mount_mod *mount_nfs = NULL;
5a83b1
 static int init_ctr = 0;
5a83b1
-static pthread_mutex_t instance_mutex = PTHREAD_MUTEX_INITIALIZER;
5a83b1
+static pthread_mutex_t parse_instance_mutex = PTHREAD_MUTEX_INITIALIZER;
5a83b1
 
5a83b1
-static void instance_mutex_lock(void)
5a83b1
+static void parse_instance_mutex_lock(void)
5a83b1
 {
5a83b1
-	int status = pthread_mutex_lock(&instance_mutex);
5a83b1
+	int status = pthread_mutex_lock(&parse_instance_mutex);
5a83b1
 	if (status)
5a83b1
 		fatal(status);
5a83b1
 }
5a83b1
 
5a83b1
-static void instance_mutex_unlock(void)
5a83b1
+static void parse_instance_mutex_unlock(void)
5a83b1
 {
5a83b1
-	int status = pthread_mutex_unlock(&instance_mutex);
5a83b1
+	int status = pthread_mutex_unlock(&parse_instance_mutex);
5a83b1
 	if (status)
5a83b1
 		fatal(status);
5a83b1
 }
5a83b1
@@ -424,7 +424,7 @@ int parse_init(int argc, const char *con
5a83b1
 
5a83b1
 	/* We only need this once.  NFS mounts are so common that we cache
5a83b1
 	   this module. */
5a83b1
-	instance_mutex_lock();
5a83b1
+	parse_instance_mutex_lock();
5a83b1
 	if (mount_nfs)
5a83b1
 		init_ctr++;
5a83b1
 	else {
5a83b1
@@ -432,11 +432,11 @@ int parse_init(int argc, const char *con
5a83b1
 			init_ctr++;
5a83b1
 		} else {
5a83b1
 			kill_context(ctxt);
5a83b1
-			instance_mutex_unlock();
5a83b1
+			parse_instance_mutex_unlock();
5a83b1
 			return 1;
5a83b1
 		}
5a83b1
 	}
5a83b1
-	instance_mutex_unlock();
5a83b1
+	parse_instance_mutex_unlock();
5a83b1
 
5a83b1
 	*context = (void *) ctxt;
5a83b1
 
5a83b1
@@ -1728,12 +1728,12 @@ int parse_done(void *context)
5a83b1
 	int rv = 0;
5a83b1
 	struct parse_context *ctxt = (struct parse_context *) context;
5a83b1
 
5a83b1
-	instance_mutex_lock();
5a83b1
+	parse_instance_mutex_lock();
5a83b1
 	if (--init_ctr == 0) {
5a83b1
 		rv = close_mount(mount_nfs);
5a83b1
 		mount_nfs = NULL;
5a83b1
 	}
5a83b1
-	instance_mutex_unlock();
5a83b1
+	parse_instance_mutex_unlock();
5a83b1
 	if (ctxt)
5a83b1
 		kill_context(ctxt);
5a83b1