aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/GpgCoreInit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/GpgCoreInit.cpp')
-rw-r--r--src/core/GpgCoreInit.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/GpgCoreInit.cpp b/src/core/GpgCoreInit.cpp
index 243dfb5e..6d782439 100644
--- a/src/core/GpgCoreInit.cpp
+++ b/src/core/GpgCoreInit.cpp
@@ -163,6 +163,19 @@ void init_gpgfrontend_core() {
custom_gnupg_install_fs_path.u8string());
}
+ // check key database path
+ std::filesystem::path custom_key_database_fs_path = custom_key_database_path;
+ if (!custom_key_database_fs_path.is_absolute() ||
+ !std::filesystem::exists(custom_key_database_fs_path) ||
+ !std::filesystem::is_directory(custom_key_database_fs_path)) {
+ use_custom_key_database_path = false;
+ SPDLOG_ERROR("core loaded custom gpg key database is illegal: {}",
+ custom_key_database_fs_path.u8string());
+ } else {
+ SPDLOG_DEBUG("core loaded custom gpg key database path: {}",
+ custom_key_database_fs_path.u8string());
+ }
+
// init default channel
auto& default_ctx = GpgFrontend::GpgContext::CreateInstance(
GPGFRONTEND_DEFAULT_CHANNEL, [=]() -> std::unique_ptr<ChannelObject> {