autofs-5.1.8 - fix invalid tsv access From: Ian Kent When using the --dumpmaps option of automount(8) a SEGV can occur because a thread specific data variable accessed in the code hasn't yet been created. The thread specific data doesn't need to be set to list the maps so we can create the key and rely on pthread_getspecific() returning NULL when the value hasn't been set as this case is handled correctly. Signed-off-by: Ian Kent --- CHANGELOG | 1 + daemon/automount.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index e3077844..ba350319 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -37,6 +37,7 @@ - improve debug logging of SASL binds. - internal SASL logging only in debug log mode. - more comprehensive verbose logging for LDAP maps. +- fix invalid tsv access. 19/10/2021 autofs-5.1.8 - add xdr_exports(). diff --git a/daemon/automount.c b/daemon/automount.c index ce790789..5f7d632b 100644 --- a/daemon/automount.c +++ b/daemon/automount.c @@ -2552,6 +2552,15 @@ int main(int argc, char *argv[]) master = argv[2]; } + status = pthread_key_create(&key_thread_stdenv_vars, + key_thread_stdenv_vars_destroy); + if (status) { + logerr("%s: failed to create thread data key for std env vars!", + program); + macro_free_global_table(); + exit(1); + } + if (master) master_list = master_new(NULL, timeout, flags); else