From b5d1505fc81a33aa10d013efd247d00f631fc681 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Tue, 28 Oct 2014 17:41:22 -0400 Subject: Add support for sqlite NSS databases We do a chdir() to the NSS database location so that libnssckbi.so is available when the database is opened. Strip off a sql: prefix if one is available. This allows the new sqlite format to work. Add an additional test pass configuring NSS using the sqlite format. This requires a bit of a hack to pass in the value to python but it will work for now. Resolves: #1057650 --- nss_engine_init.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'nss_engine_init.c') diff --git a/nss_engine_init.c b/nss_engine_init.c index 2569c8d..50b623d 100644 --- a/nss_engine_init.c +++ b/nss_engine_init.c @@ -145,6 +145,7 @@ static void nss_init_SSLLibrary(server_rec *base_server) int fipsenabled = FALSE; int ocspenabled = FALSE; int ocspdefault = FALSE; + char *dbdir = NULL; const char * ocspurl = NULL; const char * ocspname = NULL; @@ -186,7 +187,11 @@ static void nss_init_SSLLibrary(server_rec *base_server) else return; } - if (chdir(mc->pCertificateDatabase) != 0) { + if (strncasecmp(mc->pCertificateDatabase, "sql:", 4) == 0) + dbdir = mc->pCertificateDatabase + 4; + else + dbdir = mc->pCertificateDatabase; + if (chdir(dbdir) != 0) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, base_server, "Unable to change directory to %s", mc->pCertificateDatabase); if (mc->nInitCount == 1) -- cgit