Skip to content
Snippets Groups Projects
Select Git revision
  • master
1 result

zs5-multhr-hostcache

Blame
  • zs5-multhr-hostcache 1.18 KiB
    Index: nfs-utils-1.3.4/utils/gssd/gssd_proc.c
    ===================================================================
    --- nfs-utils-1.3.4.orig/utils/gssd/gssd_proc.c
    +++ nfs-utils-1.3.4/utils/gssd/gssd_proc.c
    @@ -84,6 +84,7 @@
     int num_krb5_enctypes = 0;
     krb5_enctype *krb5_enctypes = NULL;
     
    +static pthread_rwlock_t machine_credential_rwlock = PTHREAD_RWLOCK_INITIALIZER;
     /*
      * Parse the supported encryption type information
      */
    @@ -533,6 +534,7 @@ krb5_use_machine_creds(struct clnt_info
     		uid, tgtname);
     
     	do {
    +		pthread_rwlock_wrlock(&machine_credential_rwlock);
     		gssd_refresh_krb5_machine_credential(clp->servername, NULL,
     						service);
     	/*
    @@ -545,6 +547,8 @@ krb5_use_machine_creds(struct clnt_info
     				clp->servername);
     			goto out;
     		}
    +		pthread_rwlock_unlock(&machine_credential_rwlock);
    +		pthread_rwlock_rdlock(&machine_credential_rwlock);
     		for (ccname = credlist; ccname && *ccname; ccname++) {
     			u_int min_stat;
     
    @@ -583,9 +587,12 @@ krb5_use_machine_creds(struct clnt_info
     				goto out;
     			}
     		}
    +		pthread_rwlock_unlock(&machine_credential_rwlock);
     	} while(!success);
    +	return auth;
     
     out:
    +	pthread_rwlock_unlock(&machine_credential_rwlock);
     	return auth;
     }