From 5e4b316a0be6c8db56009c06d86832ad1e34ddad Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Fri, 9 Aug 2024 11:26:57 +0200 Subject: [PATCH] PR32064: SEC_ERROR_BAD_DATABASE during very first stap-server start --- nsscommon.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nsscommon.cxx b/nsscommon.cxx index f5f9e18f2..272e60a98 100644 --- a/nsscommon.cxx +++ b/nsscommon.cxx @@ -842,6 +842,13 @@ add_client_cert (const string &inFileName, const string &db_path, db_init_types // first has already called nssInit; we don't want to call nssInit twice // See if the database already exists and can be initialized. SECStatus secStatus = SECFailure; + // Make sure certificate database directory exists. + if (create_client_cert_db (db_path.c_str ()) != 0) + { + nsscommon_error (_F("Could not make sure the certificate database directory %s exists", + db_path.c_str ())); + return SECFailure; + } if (db_init_type == db_nssinitcontext) { context= nssInitContext (db_path.c_str (), 1/*readwrite*/, 0/*issueMessage*/); -- 2.43.5