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

cd8711
autofs-5.1.8 - fix invalid tsv access
cd8711
cd8711
From: Ian Kent <raven@themaw.net>
cd8711
cd8711
When using the --dumpmaps option of automount(8) a SEGV can occur
cd8711
because a thread specific data variable accessed in the code hasn't
cd8711
yet been created.
cd8711
cd8711
The thread specific data doesn't need to be set to list the maps
cd8711
so we can create the key and rely on pthread_getspecific() returning
cd8711
NULL when the value hasn't been set as this case is handled correctly.
cd8711
cd8711
Signed-off-by: Ian Kent <raven@themaw.net>
cd8711
---
cd8711
 CHANGELOG          |    1 +
cd8711
 daemon/automount.c |    9 +++++++++
cd8711
 2 files changed, 10 insertions(+)
cd8711
cd8711
--- autofs-5.1.4.orig/CHANGELOG
cd8711
+++ autofs-5.1.4/CHANGELOG
cd8711
@@ -95,6 +95,7 @@
cd8711
 - remove nonstrict parameter from tree_mapent_umount_offsets().
cd8711
 - fix handling of incorrect return from umount_ent().
cd8711
 - dont use initgroups() at spawn.
cd8711
+- fix invalid tsv access.
cd8711
 
cd8711
 xx/xx/2018 autofs-5.1.5
cd8711
 - fix flag file permission.
cd8711
--- autofs-5.1.4.orig/daemon/automount.c
cd8711
+++ autofs-5.1.4/daemon/automount.c
cd8711
@@ -2510,6 +2510,15 @@ int main(int argc, char *argv[])
cd8711
 				master = argv[2];
cd8711
 		}
cd8711
 
cd8711
+		status = pthread_key_create(&key_thread_stdenv_vars,
cd8711
+					key_thread_stdenv_vars_destroy);
cd8711
+		if (status) {
cd8711
+			logerr("%s: failed to create thread data key for std env vars!",
cd8711
+			       program);
cd8711
+			macro_free_global_table();
cd8711
+			exit(1);
cd8711
+		}
cd8711
+
cd8711
 		if (master)
cd8711
 			master_list = master_new(NULL, timeout, flags);
cd8711
 		else