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
This commit is contained in:
Ingo Klöcker 2023-11-23 16:13:39 +01:00
parent 618fea9e20
commit 1bbe2d4b70
No known key found for this signature in database
GPG Key ID: F5A5D1692277A1E9

View File

@ -64,20 +64,20 @@ 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,
err = spawnCtx->spawn(gpgconfProgram, argv,
ignoreIO, ignoreIO, ignoreIO,
Context::SpawnDetached);
}