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

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