From 1bbe2d4b707843cacf020c252ce883ec45bdbc38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Thu, 23 Nov 2023 16:13:39 +0100 Subject: [PATCH] qt: Start dirmngr with gpgconf to avoid multiple instances * lang/qt/src/qgpgmewkdlookupjob.cpp (startDirmngr): Use "gpgconf --launch dirmngr" to start dirmngr. -- Using gpgconf to start dirmngr prevents multiple instances to be started by the concurrently running keyserver lookup and WKD lookup. GnuPG-bug-id: 6833 --- lang/qt/src/qgpgmewkdlookupjob.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lang/qt/src/qgpgmewkdlookupjob.cpp b/lang/qt/src/qgpgmewkdlookupjob.cpp index 266da0d5..e862f293 100644 --- a/lang/qt/src/qgpgmewkdlookupjob.cpp +++ b/lang/qt/src/qgpgmewkdlookupjob.cpp @@ -64,22 +64,22 @@ static GpgME::Error startDirmngr(Context *assuanCtx) if (err) { qCDebug(QGPGME_LOG) << "Error: Failed to get context for spawn engine (" << err.asString() << ")"; } - - const auto dirmngrProgram = GpgME::dirInfo("dirmngr-name"); + const auto gpgconfProgram = GpgME::dirInfo("gpgconf-name"); const auto homedir = GpgME::dirInfo("homedir"); const char *argv[] = { - dirmngrProgram, + gpgconfProgram, "--homedir", homedir, - "--daemon", + "--launch", + "dirmngr", NULL }; auto ignoreIO = Data{Data::null}; if (!err) { qCDebug(QGPGME_LOG) << "Starting dirmngr ..."; - err = spawnCtx->spawnAsync(dirmngrProgram, argv, - ignoreIO, ignoreIO, ignoreIO, - Context::SpawnDetached); + err = spawnCtx->spawn(gpgconfProgram, argv, + ignoreIO, ignoreIO, ignoreIO, + Context::SpawnDetached); } if (!err) {