| Summary: | plasma-pass assumes the gnupg version by the executable name | ||
|---|---|---|---|
| Product: | [Unmaintained] plasma-pass | Reporter: | Pino Toscano <pino> |
| Component: | General | Assignee: | Daniel Vrátil <dvratil> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/plasma/plasma-pass/commit/b6ae9e8a7224efde8bfcca0c6216dfa4e273fb23 | Version Fixed/Implemented In: | 1.3.0 |
| Sentry Crash Report: | |||
Ideally I would like to use libgpgme, not sure why I did not use it in the first place... Git commit b6ae9e8a7224efde8bfcca0c6216dfa4e273fb23 by Daniel Vrátil. Committed on 21/02/2021 at 14:17. Pushed by dvratil into branch 'master'. Use QGpgme library to interact with GPG Use a library rather than invoking the gpg executable directly. One thing is that finding the right executable and the version is tricky (see #433112), it makes the code more complex. FIXED-IN: 1.3.0 M +1 -0 CMakeLists.txt M +1 -0 plugin/CMakeLists.txt M +2 -2 plugin/otpprovider.cpp M +1 -1 plugin/otpprovider.h M +2 -2 plugin/passwordprovider.cpp M +1 -1 plugin/passwordprovider.h M +31 -49 plugin/providerbase.cpp M +2 -3 plugin/providerbase.h https://invent.kde.org/plasma/plasma-pass/commit/b6ae9e8a7224efde8bfcca0c6216dfa4e273fb23 |
Looking at plugin/providerbase.cpp in plasma-pass 1.2.0, I see the following: bool isGpg2 = true; auto gpgExe = QStandardPaths::findExecutable(QStringLiteral("gpg2")); if (gpgExe.isEmpty()) { gpgExe = QStandardPaths::findExecutable(QStringLiteral("gpg")); isGpg2 = false; } This is semi-incorrect, as newer distributions (at least Debian since few years) tend to ship GnuPG 2.x as "gpg", with the old GnuPG 1.x as "gpg1". IMHO there ought to be a proper version check based on the executable itself, i.e. parsing the output of `$gpgExe --version`.