]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
auth: use crypto_init_mutex to protect NSS_Shutdown()
authorYan, Zheng <zyan@redhat.com>
Fri, 20 Mar 2015 23:13:51 +0000 (07:13 +0800)
committerLoic Dachary <ldachary@redhat.com>
Sun, 6 Sep 2015 14:05:30 +0000 (16:05 +0200)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit cf058174fe6be26129eb52f4fb24d0f7146ef7af)

src/common/ceph_crypto.cc

index 9ba29455d334a7963476bcf14a62c03901a2671f..eb46672b917a82a79145aecdff0daa9ca0278035 100644 (file)
@@ -67,9 +67,11 @@ void ceph::crypto::init(CephContext *cct)
 void ceph::crypto::shutdown()
 {
   SECStatus s;
+  pthread_mutex_lock(&crypto_init_mutex);
   s = NSS_Shutdown();
   assert(s == SECSuccess);
   crypto_init_pid = 0;
+  pthread_mutex_unlock(&crypto_init_mutex);
 }
 
 ceph::crypto::HMACSHA1::~HMACSHA1()