From 6376dfb8dfb99b9d182c2fb13aa34b2ac89805e3 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 16 Dec 2016 19:50:48 +0100 Subject: warn if clearsigned file has ignored content parts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clearsigned files like InRelease, .dsc, .changes and co can potentially include unsigned or additional messages blocks ignored by gpg in verification, but a potential source of trouble in our own parsing attempts – and an unneeded risk as the usecases for the clearsigned files we deal with do not reasonably include unsigned parts (like emails or some such). This commit changes the silent ignoring to warnings for now to get an impression on how widespread unintended unsigned parts are, but eventually we want to turn these into hard errors. --- test/libapt/getlanguages_test.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/libapt/getlanguages_test.cc') diff --git a/test/libapt/getlanguages_test.cc b/test/libapt/getlanguages_test.cc index c50ff6ff8..29ff0c9ae 100644 --- a/test/libapt/getlanguages_test.cc +++ b/test/libapt/getlanguages_test.cc @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -214,6 +215,7 @@ TEST(LanguagesTest,TranslationFiles) EXPECT_EQ(1, vec.size()); EXPECT_EQ("none", vec[0]); + _error->PushToStack(); _config->Set("Acquire::Languages", ""); //FIXME: Remove support for this deprecated setting _config->Set("APT::Acquire::Translation", "ast_DE"); @@ -228,6 +230,11 @@ TEST(LanguagesTest,TranslationFiles) EXPECT_EQ(1, vec.size()); EXPECT_EQ("en", vec[0]); + // discard the deprecation warning for APT::Acquire::Translation + if (_error->PendingError()) + _error->MergeWithStack(); + else + _error->RevertToStack(); EXPECT_EQ(0, system(std::string("rm -rf ").append(tempdir).c_str())); _config->Clear(); -- cgit v1.2.3-70-g09d2