diff options
| author | Julian Andres Klode <jak@debian.org> | 2024-11-28 09:55:57 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2024-11-28 19:01:36 +0100 |
| commit | 86f8353ce7a343db7b19422db0d37379ac45ff4e (patch) | |
| tree | 7259447c78be773163b348c196f9a59577f40427 /methods/gpgv.cc | |
| parent | 7038347919d59b2f96a8f51f994889a5b4d66cba (diff) | |
Detect working gpgv using gpgv --dump-options
This gains us support for not using an absolute path, which
is nice, and we can now cache the invocation across fork() in
the method.
Still keep preferring absolute paths, this avoids execvp() having
to iterate the path and reduces bug potential with custom gpgv in
/usr/local.
Fix the last entry in the list of gpgvs to say gpgv1
Diffstat (limited to 'methods/gpgv.cc')
| -rw-r--r-- | methods/gpgv.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 9f2ccb174..947b585da 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -190,6 +190,12 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, if (Debug == true) std::clog << "inside VerifyGetSigners" << std::endl; + // Abort early if we can't find gpgv, before forking further. This also + // caches the invocation of --dump-options to find the working gpgv across + // our fork() below. + if (APT::Internal::FindGPGV(Debug).first.empty()) + return "Internal error: Cannot find gpgv"; + int fd[2]; if (pipe(fd) < 0) |
