From 07cb47e71f4de7e3c57f9dcfbfb82e4e5566aed6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 13 Oct 2014 08:12:06 +0200 Subject: trusted=yes sources are secure, we just don't know why Do not require a special flag to be present to update trusted=yes sources as this flag in the sources.list is obviously special enough. Note that this is just disabling the error message, the user will still be warned about all the (possible) failures the repository generated, it is just triggering the acceptance of the warnings on a source-by-source level. Similarily, the trusted=no flag doesn't require the user to pass additional flags to update, if the repository looks fine in the view of apt it will update just fine. The unauthenticated warnings will "just" be presented then the data is used. In case you wonder: Both was the behavior in previous versions, too. --- apt-pkg/indexrecords.h | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'apt-pkg/indexrecords.h') diff --git a/apt-pkg/indexrecords.h b/apt-pkg/indexrecords.h index e1a2c0f74..88a06779c 100644 --- a/apt-pkg/indexrecords.h +++ b/apt-pkg/indexrecords.h @@ -26,9 +26,12 @@ class indexRecords public: struct checkSum; std::string ErrorText; - // dpointer (for later9 + + private: + enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted; + // dpointer (for later) void * d; - + protected: std::string Dist; std::string Suite; @@ -40,8 +43,7 @@ class indexRecords public: - indexRecords(); - indexRecords(const std::string ExpectedDist); + indexRecords(const std::string &ExpectedDist = ""); // Lookup function virtual checkSum *Lookup(const std::string MetaKey); @@ -50,12 +52,27 @@ class indexRecords std::vector MetaKeys(); virtual bool Load(std::string Filename); + virtual bool CheckDist(const std::string MaybeDist) const; + std::string GetDist() const; std::string GetSuite() const; bool GetSupportsAcquireByHash() const; time_t GetValidUntil() const; - virtual bool CheckDist(const std::string MaybeDist) const; std::string GetExpectedDist() const; + + /** \brief check if source is marked as always trusted */ + bool IsAlwaysTrusted() const; + /** \brief check if source is marked as never trusted */ + bool IsNeverTrusted() const; + + /** \brief sets an explicit trust value + * + * \b true means that the source should always be considered trusted, + * while \b false marks a source as always untrusted, even if we have + * a valid signature and everything. + */ + void SetTrusted(bool const Trusted); + virtual ~indexRecords(); }; -- cgit v1.2.3-70-g09d2