From 8c34e538ef7492fda87b640343996dd33a2fde1d Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Thu, 28 Apr 2016 16:21:41 -0400 Subject: gssd: use pthreads to handle upcalls Currently, to persevere global data over multiple mounts, the root process does not fork when handling an upcall. Instead on not-forking create a pthread to handle the upcall since global data can be shared among threads. Reviewed-by: Jeff Layton Signed-off-by: Olga Kornievskaia Signed-off-by: Steve Dickson --- utils/gssd/krb5_util.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'utils/gssd/krb5_util.c') diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c index 8dc64fe..a690043 100644 --- a/utils/gssd/krb5_util.c +++ b/utils/gssd/krb5_util.c @@ -128,6 +128,7 @@ /* Global list of principals/cache file names for machine credentials */ struct gssd_k5_kt_princ *gssd_k5_kt_princ_list = NULL; +pthread_mutex_t ple_lock = PTHREAD_MUTEX_INITIALIZER; #ifdef HAVE_SET_ALLOWABLE_ENCTYPES int limit_to_legacy_enctypes = 0; @@ -586,10 +587,12 @@ get_ple_by_princ(krb5_context context, krb5_principal princ) /* Need to serialize list if we ever become multi-threaded! */ + pthread_mutex_lock(&ple_lock); ple = find_ple_by_princ(context, princ); if (ple == NULL) { ple = new_ple(context, princ); } + pthread_mutex_unlock(&ple_lock); return ple; } -- cgit