[poppler] poppler/SignatureHandler.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Nov 17 18:43:32 UTC 2018


 poppler/SignatureHandler.cc |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit a85c2ed8f4359341adb94887c4b551a761244fdb
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Nov 17 19:29:16 2018 +0100

    Be more stubborn looking for a nssdb
    
    Fixes issue #669

diff --git a/poppler/SignatureHandler.cc b/poppler/SignatureHandler.cc
index aedccf7a..6c510229 100644
--- a/poppler/SignatureHandler.cc
+++ b/poppler/SignatureHandler.cc
@@ -114,10 +114,19 @@ GooString *SignatureHandler::getDefaultFirefoxCertDB_Linux()
 void SignatureHandler::init_nss() 
 {
   GooString *certDBPath = getDefaultFirefoxCertDB_Linux();
+  bool initSuccess = false;
   if (certDBPath == nullptr) {
-    NSS_Init("sql:/etc/pki/nssdb");
+    initSuccess = (NSS_Init("sql:/etc/pki/nssdb") == SECSuccess);
   } else {
-    NSS_Init(certDBPath->c_str());
+    initSuccess = (NSS_Init(certDBPath->c_str()) == SECSuccess);
+  }
+  if (!initSuccess) {
+    GooString homeNssDb(getenv("HOME"));
+    homeNssDb.append("/.pki/nssdb");
+    initSuccess = (NSS_Init(homeNssDb.c_str()) == SECSuccess);
+    if (!initSuccess) {
+      NSS_NoDB_Init(nullptr);
+    }
   }
   //Make sure NSS root certificates module is loaded
   SECMOD_AddNewModule("Root Certs", "libnssckbi.so", 0, 0);


More information about the poppler mailing list