From acfaae9d467e8d5722f3f2a5abe0cd31690f026e Mon Sep 17 00:00:00 2001 From: Esa Korhonen Date: Thu, 13 Jun 2019 17:42:42 +0300 Subject: [PATCH] MXS-2480 Use in-memory-database in PAM authenticator This was already fixed in develop, but the fix is both small and useful so should be backported. --- server/modules/authenticator/PAM/PAMAuth/pam_client_session.cc | 2 +- server/modules/authenticator/PAM/PAMAuth/pam_instance.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/modules/authenticator/PAM/PAMAuth/pam_client_session.cc b/server/modules/authenticator/PAM/PAMAuth/pam_client_session.cc index 04cb7afec..9b049404e 100644 --- a/server/modules/authenticator/PAM/PAMAuth/pam_client_session.cc +++ b/server/modules/authenticator/PAM/PAMAuth/pam_client_session.cc @@ -204,7 +204,7 @@ PamClientSession* PamClientSession::create(const PamInstance& inst) { // This handle is only used from one thread, can define no_mutex. sqlite3* dbhandle = NULL; - int db_flags = SQLITE_OPEN_READONLY | SQLITE_OPEN_SHAREDCACHE | SQLITE_OPEN_NOMUTEX; + int db_flags = SQLITE_OPEN_URI | SQLITE_OPEN_READONLY | SQLITE_OPEN_SHAREDCACHE | SQLITE_OPEN_NOMUTEX; if (sqlite3_open_v2(inst.m_dbname.c_str(), &dbhandle, db_flags, NULL) == SQLITE_OK) { sqlite3_busy_timeout(dbhandle, 1000); diff --git a/server/modules/authenticator/PAM/PAMAuth/pam_instance.cc b/server/modules/authenticator/PAM/PAMAuth/pam_instance.cc index 23d2c6adc..4f7135028 100644 --- a/server/modules/authenticator/PAM/PAMAuth/pam_instance.cc +++ b/server/modules/authenticator/PAM/PAMAuth/pam_instance.cc @@ -49,7 +49,7 @@ PamInstance* PamInstance::create(char **options) bool error = false; /* This handle may be used from multiple threads, set full mutex. */ sqlite3* dbhandle = NULL; - int db_flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | + int db_flags = SQLITE_OPEN_URI | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_SHAREDCACHE | SQLITE_OPEN_FULLMUTEX; if (sqlite3_open_v2(pam_db_name.c_str(), &dbhandle, db_flags, NULL) != SQLITE_OK) {