From 09c76cb29b61e1d523a30287f8a9bf0cb0b608e7 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 22 Jan 2025 09:34:37 +0100 Subject: sqv, gpgv: Do not fail if Dir::Etc::Trusted is set and trusted.gpg.d is missing This should remain a warning case for now. So push the errors to a stack and see if we can find any file. Explictly warn again if Dir::Etc::trusted is set, as it is like _super_ deprecated. Reported-By: Cyril Brulebois in Bug#1032131 --- methods/sqv.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'methods') diff --git a/methods/sqv.cc b/methods/sqv.cc index 9dbe75994..3191752cc 100644 --- a/methods/sqv.cc +++ b/methods/sqv.cc @@ -132,9 +132,20 @@ bool SQVMethod::VerifyGetSigners(const char *file, const char *outfile, }; if (keyFiles.empty()) { + // Either trusted or trustedparts must exist + _error->PushToStack(); auto Parts = GetListOfFilesInDir(_config->FindDir("Dir::Etc::TrustedParts"), std::vector{"gpg", "asc"}, true); if (auto trusted = _config->FindFile("Dir::Etc::Trusted"); not trusted.empty()) + { + std::string s; + strprintf(s, "Loading %s from deprecated option Dir::Etc::Trusted\n", trusted.c_str()); + Warning(std::move(s)); Parts.push_back(trusted); + } + if (Parts.empty()) + _error->MergeWithStack(); + else + _error->RevertToStack(); for (auto &Part : Parts) { if (Debug) -- cgit v1.2.3-70-g09d2