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

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