Blame SOURCES/autofs-5.1.8-fix-invalid-tsv-access.patch

5a83b1
autofs-5.1.8 - fix invalid tsv access
5a83b1
5a83b1
From: Ian Kent <raven@themaw.net>
5a83b1
5a83b1
When using the --dumpmaps option of automount(8) a SEGV can occur
5a83b1
because a thread specific data variable accessed in the code hasn't
5a83b1
yet been created.
5a83b1
5a83b1
The thread specific data doesn't need to be set to list the maps
5a83b1
so we can create the key and rely on pthread_getspecific() returning
5a83b1
NULL when the value hasn't been set as this case is handled correctly.
5a83b1
5a83b1
Signed-off-by: Ian Kent <raven@themaw.net>
5a83b1
---
5a83b1
 CHANGELOG          |    1 +
5a83b1
 daemon/automount.c |    9 +++++++++
5a83b1
 2 files changed, 10 insertions(+)
5a83b1
5a83b1
--- autofs-5.1.7.orig/CHANGELOG
5a83b1
+++ autofs-5.1.7/CHANGELOG
5a83b1
@@ -102,6 +102,7 @@
5a83b1
 - bailout on rpc systemerror.
5a83b1
 - fix nfsv4 only mounts should not use rpcbind.
5a83b1
 - dont use initgroups() at spawn.
5a83b1
+- fix invalid tsv access.
5a83b1
 
5a83b1
 25/01/2021 autofs-5.1.7
5a83b1
 - make bind mounts propagation slave by default.
5a83b1
--- autofs-5.1.7.orig/daemon/automount.c
5a83b1
+++ autofs-5.1.7/daemon/automount.c
5a83b1
@@ -2518,6 +2518,15 @@ int main(int argc, char *argv[])
5a83b1
 				master = argv[2];
5a83b1
 		}
5a83b1
 
5a83b1
+		status = pthread_key_create(&key_thread_stdenv_vars,
5a83b1
+					key_thread_stdenv_vars_destroy);
5a83b1
+		if (status) {
5a83b1
+			logerr("%s: failed to create thread data key for std env vars!",
5a83b1
+			       program);
5a83b1
+			macro_free_global_table();
5a83b1
+			exit(1);
5a83b1
+		}
5a83b1
+
5a83b1
 		if (master)
5a83b1
 			master_list = master_new(NULL, timeout, flags);
5a83b1
 		else