From 6bb1c85fd045e421be36957453ee318c0cea8fb0 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 26 Feb 2020 15:52:42 +0100 Subject: symbols: Bump version from 1.9.10 to 1.9.11~ --- debian/libapt-pkg6.0.symbols | 84 ++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/debian/libapt-pkg6.0.symbols b/debian/libapt-pkg6.0.symbols index 4ae0dca2d..fb58cfc6f 100644 --- a/debian/libapt-pkg6.0.symbols +++ b/debian/libapt-pkg6.0.symbols @@ -197,7 +197,7 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"pkgSimulate::Remove(pkgCache::PkgIterator, bool)@APTPKG_6.0" 0.8.0 (c++)"pkgSimulate::Install(pkgCache::PkgIterator, std::__cxx11::basic_string, std::allocator >)@APTPKG_6.0" 0.8.0 (c++)"pkgSimulate::Configure(pkgCache::PkgIterator)@APTPKG_6.0" 0.8.0 - (c++)"pkgSimulate::Go(APT::Progress::PackageManager*)@APTPKG_6.0" 1.9.10 + (c++)"pkgSimulate::Go(APT::Progress::PackageManager*)@APTPKG_6.0" 1.9.11~ (c++)"pkgSimulate::pkgSimulate(pkgDepCache*)@APTPKG_6.0" 0.8.0 (c++)"pkgSimulate::~pkgSimulate()@APTPKG_6.0" 0.8.0 (c++)"pkgAcqMethod::FetchResult::TakeHashes(Hashes&)@APTPKG_6.0" 0.8.0 @@ -1288,14 +1288,14 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"vtable for SigVerify@APTPKG_6.0" 1.1~exp9 (c++)"vtable for TranslationsCopy@APTPKG_6.0" 1.1~exp9 ### ABI 6 - (c++)"APT::CacheFilter::ParsePattern(APT::StringView, pkgCacheFile*)@APTPKG_6.0" 1.9.10 - (c++)"APT::CacheSetHelper::PackageFromPattern(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_6.0" 1.9.10 - (c++)"APT::CacheSetHelper::showPatternSelection(pkgCache::PkgIterator const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_6.0" 1.9.10 - (c++)"APT::String::DisplayLength(APT::StringView)@APTPKG_6.0" 1.9.10 - (c++)"Hashes::GetHashString(Hashes::SupportedHashes)@APTPKG_6.0" 1.9.10 - (c++)"pkgCache::VerIterator::TranslatedDescriptionForLanguage(APT::StringView) const@APTPKG_6.0" 1.9.10 - (c++)"pkgPolicy::SetPriority(pkgCache::PkgFileIterator const&, short)@APTPKG_6.0" 1.9.10 - (c++)"pkgPolicy::SetPriority(pkgCache::VerIterator const&, short)@APTPKG_6.0" 1.9.10 + (c++)"APT::CacheFilter::ParsePattern(APT::StringView, pkgCacheFile*)@APTPKG_6.0" 1.9.11~ + (c++)"APT::CacheSetHelper::PackageFromPattern(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_6.0" 1.9.11~ + (c++)"APT::CacheSetHelper::showPatternSelection(pkgCache::PkgIterator const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_6.0" 1.9.11~ + (c++)"APT::String::DisplayLength(APT::StringView)@APTPKG_6.0" 1.9.11~ + (c++)"Hashes::GetHashString(Hashes::SupportedHashes)@APTPKG_6.0" 1.9.11~ + (c++)"pkgCache::VerIterator::TranslatedDescriptionForLanguage(APT::StringView) const@APTPKG_6.0" 1.9.11~ + (c++)"pkgPolicy::SetPriority(pkgCache::PkgFileIterator const&, short)@APTPKG_6.0" 1.9.11~ + (c++)"pkgPolicy::SetPriority(pkgCache::VerIterator const&, short)@APTPKG_6.0" 1.9.11~ ### dpkg selection state changer & general dpkg interfacing (c++)"APT::StateChanges::clear()@APTPKG_6.0" 1.1~exp15 (c++)"APT::StateChanges::empty() const@APTPKG_6.0" 1.1~exp15 @@ -1418,11 +1418,11 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"RemoveFileAt(char const*, int, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_6.0" 1.5~beta2~ (c++|optional=std)"void std::vector >::emplace_back(pkgAcquireStatus::ReleaseInfoChange&&)@APTPKG_6.0" 1.5~beta2~ (c++)"pkgAcqMethod::FetchItem::Proxy[abi:cxx11]()@APTPKG_6.0" 1.6~alpha1~ - (c++)"debSystem::ArchitecturesSupported[abi:cxx11]() const@APTPKG_6.0" 1.9.10 - (c++)"debSystem::MultiArchSupported() const@APTPKG_6.0" 1.9.10 - (c++)"debSystem::IsLocked()@APTPKG_6.0" 1.9.10 - (c++)"debSystem::LockInner()@APTPKG_6.0" 1.9.10 - (c++)"debSystem::UnLockInner(bool)@APTPKG_6.0" 1.9.10 + (c++)"debSystem::ArchitecturesSupported[abi:cxx11]() const@APTPKG_6.0" 1.9.11~ + (c++)"debSystem::MultiArchSupported() const@APTPKG_6.0" 1.9.11~ + (c++)"debSystem::IsLocked()@APTPKG_6.0" 1.9.11~ + (c++)"debSystem::LockInner()@APTPKG_6.0" 1.9.11~ + (c++)"debSystem::UnLockInner(bool)@APTPKG_6.0" 1.9.11~ # gcc-8 artifacts (c++|optional=std)"std::enable_if >, std::is_move_constructible, std::is_move_assignable >::value, void>::type std::swap(IndexTarget&, IndexTarget&)@APTPKG_6.0" 1.5~beta2~ (c++|optional=std)"pkgAcqMethod::SendMessage(std::__cxx11::basic_string, std::allocator > const&, std::unordered_map, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::hash, std::allocator > >, std::equal_to, std::allocator > >, std::allocator, std::allocator > const, std::__cxx11::basic_string, std::allocator > > > >&&)@APTPKG_6.0" 1.7.0~alpha3~ @@ -1477,35 +1477,35 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++|optional=std)"std::vector >::~vector()@APTPKG_6.0" 0.8.12 (c++|optional=std)"void std::__cxx11::basic_string, std::allocator >::_M_construct(char*, char*, std::forward_iterator_tag)@APTPKG_6.0" 1.7.0~alpha3~ (c++|optional=std)"void std::__cxx11::basic_string, std::allocator >::_M_construct(char const*, char const*, std::forward_iterator_tag)@APTPKG_6.0" 1.7.0~alpha3~ - (c++|optional=std)"typeinfo for std::_Mutex_base<(__gnu_cxx::_Lock_policy)2>@APTPKG_6.0" 1.9.10 - (c++|optional=std)"typeinfo for std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>@APTPKG_6.0" 1.9.10 - (c++|optional=std)"typeinfo for std::_Sp_counted_deleter<__res_state*, void (*)(__res_state*), std::allocator, (__gnu_cxx::_Lock_policy)2>@APTPKG_6.0" 1.9.10 - (c++|optional=std)"typeinfo name for std::_Mutex_base<(__gnu_cxx::_Lock_policy)2>@APTPKG_6.0" 1.9.10 - (c++|optional=std)"typeinfo name for std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>@APTPKG_6.0" 1.9.10 - (c++|optional=std)"typeinfo name for std::_Sp_counted_deleter<__res_state*, void (*)(__res_state*), std::allocator, (__gnu_cxx::_Lock_policy)2>@APTPKG_6.0" 1.9.10 - (c++|optional=std)"typeinfo name for void (*)(__res_state*)@APTPKG_6.0" 1.9.10 - (c++|optional=std)"vtable for std::_Sp_counted_deleter<__res_state*, void (*)(__res_state*), std::allocator, (__gnu_cxx::_Lock_policy)2>@APTPKG_6.0" 1.9.10 + (c++|optional=std)"typeinfo for std::_Mutex_base<(__gnu_cxx::_Lock_policy)2>@APTPKG_6.0" 1.9.11~ + (c++|optional=std)"typeinfo for std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>@APTPKG_6.0" 1.9.11~ + (c++|optional=std)"typeinfo for std::_Sp_counted_deleter<__res_state*, void (*)(__res_state*), std::allocator, (__gnu_cxx::_Lock_policy)2>@APTPKG_6.0" 1.9.11~ + (c++|optional=std)"typeinfo name for std::_Mutex_base<(__gnu_cxx::_Lock_policy)2>@APTPKG_6.0" 1.9.11~ + (c++|optional=std)"typeinfo name for std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>@APTPKG_6.0" 1.9.11~ + (c++|optional=std)"typeinfo name for std::_Sp_counted_deleter<__res_state*, void (*)(__res_state*), std::allocator, (__gnu_cxx::_Lock_policy)2>@APTPKG_6.0" 1.9.11~ + (c++|optional=std)"typeinfo name for void (*)(__res_state*)@APTPKG_6.0" 1.9.11~ + (c++|optional=std)"vtable for std::_Sp_counted_deleter<__res_state*, void (*)(__res_state*), std::allocator, (__gnu_cxx::_Lock_policy)2>@APTPKG_6.0" 1.9.11~ ### try to ignore std:: template instances (c++)"void std::vector >::emplace_back(APT::Configuration::Compressor&&)@APTPKG_6.0" 1.9~ (c++)"void std::vector >::emplace_back(APT::StringView*&&)@APTPKG_6.0" 1.9~ - (regex|optional)".*hash32.*\.ifunc@APTPKG_6.0" 1.9.10 + (regex|optional)".*hash32.*\.ifunc@APTPKG_6.0" 1.9.11~ ### Internal functions needed for testing purposes - (c++)"APT::Internal::Patterns::BaseRegexMatcher::~BaseRegexMatcher()@APTPKG_6.0" 1.9.10 - (c++)"APT::Internal::Patterns::BaseRegexMatcher::BaseRegexMatcher(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_6.0" 1.9.10 - (c++)"APT::Internal::Patterns::BaseRegexMatcher::operator()(char const*)@APTPKG_6.0" 1.9.10 - (c++)"APT::Internal::PatternTreeParser::Node::error(std::__cxx11::basic_string, std::allocator >)@APTPKG_6.0" 1.9.10 - (c++)"APT::Internal::PatternTreeParser::parse()@APTPKG_6.0" 1.9.10 - (c++)"APT::Internal::PatternTreeParser::parseTop()@APTPKG_6.0" 1.9.10 - (c++)"typeinfo for APT::Internal::PatternTreeParser::Error@APTPKG_6.0" 1.9.10 - (c++)"typeinfo for APT::Internal::PatternTreeParser::Node@APTPKG_6.0" 1.9.10 - (c++)"typeinfo for APT::Internal::PatternTreeParser::PatternNode@APTPKG_6.0" 1.9.10 - (c++)"typeinfo for APT::Internal::PatternTreeParser::WordNode@APTPKG_6.0" 1.9.10 - (c++)"typeinfo name for APT::Internal::PatternTreeParser::Error@APTPKG_6.0" 1.9.10 - (c++)"typeinfo name for APT::Internal::PatternTreeParser::Node@APTPKG_6.0" 1.9.10 - (c++)"typeinfo name for APT::Internal::PatternTreeParser::PatternNode@APTPKG_6.0" 1.9.10 - (c++)"typeinfo name for APT::Internal::PatternTreeParser::WordNode@APTPKG_6.0" 1.9.10 - (c++)"void std::vector >, std::allocator > > >::emplace_back > >(std::unique_ptr >&&)@APTPKG_6.0" 1.9.10 - (c++)"vtable for APT::Internal::PatternTreeParser::Error@APTPKG_6.0" 1.9.10 - (c++)"vtable for APT::Internal::PatternTreeParser::Node@APTPKG_6.0" 1.9.10 - (c++)"vtable for APT::Internal::PatternTreeParser::PatternNode@APTPKG_6.0" 1.9.10 - (c++)"vtable for APT::Internal::PatternTreeParser::WordNode@APTPKG_6.0" 1.9.10 + (c++)"APT::Internal::Patterns::BaseRegexMatcher::~BaseRegexMatcher()@APTPKG_6.0" 1.9.11~ + (c++)"APT::Internal::Patterns::BaseRegexMatcher::BaseRegexMatcher(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_6.0" 1.9.11~ + (c++)"APT::Internal::Patterns::BaseRegexMatcher::operator()(char const*)@APTPKG_6.0" 1.9.11~ + (c++)"APT::Internal::PatternTreeParser::Node::error(std::__cxx11::basic_string, std::allocator >)@APTPKG_6.0" 1.9.11~ + (c++)"APT::Internal::PatternTreeParser::parse()@APTPKG_6.0" 1.9.11~ + (c++)"APT::Internal::PatternTreeParser::parseTop()@APTPKG_6.0" 1.9.11~ + (c++)"typeinfo for APT::Internal::PatternTreeParser::Error@APTPKG_6.0" 1.9.11~ + (c++)"typeinfo for APT::Internal::PatternTreeParser::Node@APTPKG_6.0" 1.9.11~ + (c++)"typeinfo for APT::Internal::PatternTreeParser::PatternNode@APTPKG_6.0" 1.9.11~ + (c++)"typeinfo for APT::Internal::PatternTreeParser::WordNode@APTPKG_6.0" 1.9.11~ + (c++)"typeinfo name for APT::Internal::PatternTreeParser::Error@APTPKG_6.0" 1.9.11~ + (c++)"typeinfo name for APT::Internal::PatternTreeParser::Node@APTPKG_6.0" 1.9.11~ + (c++)"typeinfo name for APT::Internal::PatternTreeParser::PatternNode@APTPKG_6.0" 1.9.11~ + (c++)"typeinfo name for APT::Internal::PatternTreeParser::WordNode@APTPKG_6.0" 1.9.11~ + (c++)"void std::vector >, std::allocator > > >::emplace_back > >(std::unique_ptr >&&)@APTPKG_6.0" 1.9.11~ + (c++)"vtable for APT::Internal::PatternTreeParser::Error@APTPKG_6.0" 1.9.11~ + (c++)"vtable for APT::Internal::PatternTreeParser::Node@APTPKG_6.0" 1.9.11~ + (c++)"vtable for APT::Internal::PatternTreeParser::PatternNode@APTPKG_6.0" 1.9.11~ + (c++)"vtable for APT::Internal::PatternTreeParser::WordNode@APTPKG_6.0" 1.9.11~ -- cgit v1.2.3 From 110078022a6c6103be8f557aef1e268c4b680d88 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 20 Feb 2020 12:49:15 +0100 Subject: Parse records including empty tag names correctly No sensible file should include these, but even insensible files do not gain unfair advantages with it as this parser does not deal with security critical files before they haven't passed other checks like signatures or hashsums. The problem is that the parser accepts and parses empty tag names correctly, but does not store the data parsed which will effect later passes over the data resulting e.g. in the following tag containing the name and value of the previous (empty) tag, its own tagname and its own value or a crash due to an attempt to access invalid memory depending on who passes over the data and what is done with it. This commit fixes both, the incidient of the crash reported by Anatoly Trosinenko who reproduced it via apt-sortpkgs: | $ cat /tmp/Packages-null | 0: | PACKAGE:0 | | : | PACKAGE: | | PACKAGE:: | $ apt-sortpkgs /tmp/Packages-null and the deeper parsing issue shown by the included testcase. Reported-By: Anatoly Trosinenko References: 8710a36a01c0cb1648926792c2ad05185535558e --- apt-pkg/tagfile.cc | 5 ++-- test/libapt/tagfile_test.cc | 58 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 0f0d8c9a7..52000c6b9 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -513,7 +513,6 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const R return false; pkgTagSectionPrivate::TagData lastTagData(0); - lastTagData.EndTag = 0; Key lastTagKey = Key::Unknown; unsigned int lastTagHash = 0; while (Stop < End) @@ -529,7 +528,7 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const R if (isspace_ascii(Stop[0]) == 0) { // store the last found tag - if (lastTagData.EndTag != 0) + if (lastTagData.StartValue != 0) { if (lastTagKey != Key::Unknown) { AlphaIndexes[static_cast(lastTagKey)] = TagCount; @@ -579,7 +578,7 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const R // Double newline marks the end of the record if (Stop+1 < End && Stop[1] == '\n') { - if (lastTagData.EndTag != 0) + if (lastTagData.StartValue != 0) { if (lastTagKey != Key::Unknown) { AlphaIndexes[static_cast(lastTagKey)] = TagCount; diff --git a/test/libapt/tagfile_test.cc b/test/libapt/tagfile_test.cc index 8823ff781..919b46cdb 100644 --- a/test/libapt/tagfile_test.cc +++ b/test/libapt/tagfile_test.cc @@ -285,3 +285,61 @@ TEST(TagFileTest, Comments) EXPECT_FALSE(tfile.Step(section)); } + +TEST(TagFileTest, EmptyTagName) +{ + FileFd fd; + createTemporaryFile("emptytagname", fd, NULL, "0:\n" +"PACKAGE:0\n" +"\n" +":\n" +"PACKAGE:\n" +"\n" +"PACKAGE:\n" +":\n" +"\n" +"PACKAGE:\n" +":\n" +"Version:1\n" +"\n" +"PACKAGE::\n" + ); + pkgTagFile tfile(&fd); + pkgTagSection section; + ASSERT_TRUE(tfile.Step(section)); + EXPECT_EQ(2u, section.Count()); + EXPECT_TRUE(section.Exists("PACKAGE")); + EXPECT_EQ("0", section.FindS("PACKAGE")); + EXPECT_TRUE(section.Exists("0")); + EXPECT_EQ("", section.FindS("0")); + + ASSERT_TRUE(tfile.Step(section)); + EXPECT_EQ(2u, section.Count()); + EXPECT_TRUE(section.Exists("PACKAGE")); + EXPECT_EQ("", section.FindS("PACKAGE")); + EXPECT_TRUE(section.Exists("")); + EXPECT_EQ("", section.FindS("")); + + ASSERT_TRUE(tfile.Step(section)); + EXPECT_EQ(2u, section.Count()); + EXPECT_TRUE(section.Exists("PACKAGE")); + EXPECT_EQ("", section.FindS("PACKAGE")); + EXPECT_TRUE(section.Exists("")); + EXPECT_EQ("", section.FindS("")); + + ASSERT_TRUE(tfile.Step(section)); + EXPECT_EQ(3u, section.Count()); + EXPECT_TRUE(section.Exists("PACKAGE")); + EXPECT_EQ("", section.FindS("PACKAGE")); + EXPECT_TRUE(section.Exists("")); + EXPECT_EQ("", section.FindS("")); + EXPECT_TRUE(section.Exists("Version")); + EXPECT_EQ("1", section.FindS("Version")); + + ASSERT_TRUE(tfile.Step(section)); + EXPECT_EQ(1u, section.Count()); + EXPECT_TRUE(section.Exists("PACKAGE")); + EXPECT_EQ(":", section.FindS("PACKAGE")); + + EXPECT_FALSE(tfile.Step(section)); +} -- cgit v1.2.3 From d36b06d7eb300ca5cbee22b4fcedaefc80585da1 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 26 Feb 2020 18:26:13 +0100 Subject: Fix various compiler warnings --- apt-pkg/cachefilter-patterns.h | 2 +- apt-pkg/contrib/strutl.cc | 4 ---- apt-pkg/edsp/edspsystem.h | 2 +- apt-pkg/metaindex.cc | 6 +++--- debian/libapt-pkg6.0.symbols | 1 - 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/apt-pkg/cachefilter-patterns.h b/apt-pkg/cachefilter-patterns.h index 2071c80b3..0c0dafa15 100644 --- a/apt-pkg/cachefilter-patterns.h +++ b/apt-pkg/cachefilter-patterns.h @@ -261,7 +261,7 @@ struct APT_HIDDEN PackageIsVirtual : public PackageMatcher struct APT_HIDDEN VersionAnyMatcher : public Matcher { - bool operator()(pkgCache::GrpIterator const &Grp) override { return false; } + bool operator()(pkgCache::GrpIterator const &) override { return false; } bool operator()(pkgCache::VerIterator const &Ver) override = 0; bool operator()(pkgCache::PkgIterator const &Pkg) override { diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 70befdc48..972472986 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -1044,10 +1044,6 @@ static time_t timegm(struct tm *t) we allow them here to to be able to reuse the method. Either way, a date must be in UTC or parsing will fail. Previous implementations of this method used to ignore the timezone and assume always UTC. */ -bool RFC1123StrToTime(const char* const str,time_t &time) -{ - return RFC1123StrToTime(std::string(str), time); -} bool RFC1123StrToTime(std::string const &str,time_t &time) { unsigned short day = 0; diff --git a/apt-pkg/edsp/edspsystem.h b/apt-pkg/edsp/edspsystem.h index 9e34345cd..33f06c4d5 100644 --- a/apt-pkg/edsp/edspsystem.h +++ b/apt-pkg/edsp/edspsystem.h @@ -42,7 +42,7 @@ public: std::vector ArchitecturesSupported() const override { return {}; }; bool LockInner() override { return _error->Error("LockInner is not implemented"); }; - bool UnLockInner(bool NoErrors=false) override { return _error->Error("UnLockInner is not implemented"); }; + bool UnLockInner(bool) override { return _error->Error("UnLockInner is not implemented"); }; bool IsLocked() override { return true; }; explicit edspLikeSystem(char const * const Label); diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index 06db06f83..fc03f3db0 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -131,17 +131,17 @@ void metaIndex::swapLoad(metaIndex * const OldMetaIndex) /*{{{*/ } /*}}}*/ -bool metaIndex::IsArchitectureSupported(std::string const &arch) const /*{{{*/ +bool metaIndex::IsArchitectureSupported(std::string const &) const /*{{{*/ { return true; } /*}}}*/ -bool metaIndex::IsArchitectureAllSupportedFor(IndexTarget const &target) const/*{{{*/ +bool metaIndex::IsArchitectureAllSupportedFor(IndexTarget const &) const/*{{{*/ { return true; } /*}}}*/ -bool metaIndex::HasSupportForComponent(std::string const &component) const/*{{{*/ +bool metaIndex::HasSupportForComponent(std::string const &) const/*{{{*/ { return true; } diff --git a/debian/libapt-pkg6.0.symbols b/debian/libapt-pkg6.0.symbols index fb58cfc6f..5add3bd93 100644 --- a/debian/libapt-pkg6.0.symbols +++ b/debian/libapt-pkg6.0.symbols @@ -627,7 +627,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# ### architecture specific: time_t (arch=!x32|c++)"FTPMDTMStrToTime(char const*, long&)@APTPKG_6.0" 0.8.0 (arch=x32|c++)"FTPMDTMStrToTime(char const*, long long&)@APTPKG_6.0" 0.8.0 - (arch=!x32|c++)"RFC1123StrToTime(char const*, long&)@APTPKG_6.0" 0.8.0 (arch=x32|c++)"RFC1123StrToTime(char const*, long long&)@APTPKG_6.0" 0.8.0 (arch=!x32|c++)"RFC1123StrToTime(std::__cxx11::basic_string, std::allocator > const&, long&)@APTPKG_6.0" 1.9.0 (arch=x32|c++)"RFC1123StrToTime(std::__cxx11::basic_string, std::allocator > const&, long long&)@APTPKG_6.0" 1.9.0 -- cgit v1.2.3 From 62ca61ff4ac794f9c42335d8286343149d4313d1 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 26 Feb 2020 18:46:06 +0100 Subject: cacheset: Fix -Wdeprecated-copy warnings Remove the operator= from Container_iterator, as it was basically just the default anyway, and add copy constructors to *Interface that match their operator=. Tried adding copy constructor to Container_iterator, but that only made things worse. --- apt-pkg/cacheset.cc | 4 ++++ apt-pkg/cacheset.h | 8 ++++---- debian/libapt-pkg6.0.symbols | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc index ae1d5ee3e..288180f16 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -915,6 +915,7 @@ CacheSetHelper::CacheSetHelper(bool const ShowError, GlobalError::MsgType ErrorT CacheSetHelper::~CacheSetHelper() {} PackageContainerInterface::PackageContainerInterface() : ConstructedBy(CacheSetHelper::UNKNOWN), d(NULL) {} +PackageContainerInterface::PackageContainerInterface(PackageContainerInterface const &by) : PackageContainerInterface() { *this = by; } PackageContainerInterface::PackageContainerInterface(CacheSetHelper::PkgSelector const by) : ConstructedBy(by), d(NULL) {} PackageContainerInterface& PackageContainerInterface::operator=(PackageContainerInterface const &other) { if (this != &other) @@ -928,6 +929,9 @@ PackageUniverse::PackageUniverse(pkgCacheFile * const Owner) : _cont(Owner->GetP PackageUniverse::~PackageUniverse() {} VersionContainerInterface::VersionContainerInterface() : d(NULL) {} +VersionContainerInterface::VersionContainerInterface(VersionContainerInterface const &other) : VersionContainerInterface() { + *this = other; +}; VersionContainerInterface& VersionContainerInterface::operator=(VersionContainerInterface const &) { return *this; } diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 6023b861d..bfb9e0abf 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -201,7 +201,7 @@ template(this)->getType(); }; operator container_iterator(void) const { return _iter; } inline iterator_type& operator++() { ++_iter; return static_cast(*this); } @@ -241,12 +241,10 @@ template class Container_iterato typedef Container_iterator iterator_type; typedef typename Container::iterator container_iterator; public: - explicit Container_iterator(container_iterator i) : + explicit Container_iterator(container_iterator const &i) : Container_iterator_base(i) {} operator typename Master::const_iterator() { return typename Master::const_iterator(this->_iter); } - inline iterator_type& operator=(iterator_type const &i) { this->_iter = i._iter; return static_cast(*this); } - inline iterator_type& operator=(container_iterator const &i) { this->_iter = i; return static_cast(*this); } inline typename Container::iterator::reference operator*(void) const { return *this->_iter; } inline typename Container::value_type getType(void) const { return *this->_iter; } @@ -325,6 +323,7 @@ public: CacheSetHelper::PkgSelector getConstructor() const { return ConstructedBy; } PackageContainerInterface(); explicit PackageContainerInterface(CacheSetHelper::PkgSelector const by); + PackageContainerInterface(PackageContainerInterface const &by); PackageContainerInterface& operator=(PackageContainerInterface const &other); virtual ~PackageContainerInterface(); @@ -762,6 +761,7 @@ public: CacheSetHelper &helper); VersionContainerInterface(); + VersionContainerInterface(VersionContainerInterface const &other); VersionContainerInterface& operator=(VersionContainerInterface const &other); virtual ~VersionContainerInterface(); private: diff --git a/debian/libapt-pkg6.0.symbols b/debian/libapt-pkg6.0.symbols index 5add3bd93..a9ffaf882 100644 --- a/debian/libapt-pkg6.0.symbols +++ b/debian/libapt-pkg6.0.symbols @@ -1018,6 +1018,7 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"APT::Configuration::getLanguages[abi:cxx11](bool const&, bool const&, char const**)@APTPKG_6.0" 1.1~exp9 (c++)"APT::PackageContainerInterface::operator=(APT::PackageContainerInterface const&)@APTPKG_6.0" 1.1~exp9 (c++)"APT::PackageContainerInterface::PackageContainerInterface(APT::CacheSetHelper::PkgSelector)@APTPKG_6.0" 1.1~exp9 + (c++)"APT::PackageContainerInterface::PackageContainerInterface(APT::PackageContainerInterface const&)@APTPKG_6.0" 1.9.11~ (c++)"APT::PackageContainerInterface::~PackageContainerInterface()@APTPKG_6.0" 1.1~exp9 (c++)"APT::PackageContainerInterface::PackageContainerInterface()@APTPKG_6.0" 1.1~exp9 (c++)"APT::PackageUniverse::~PackageUniverse()@APTPKG_6.0" 1.1~exp9 @@ -1028,6 +1029,7 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"APT::VersionContainerInterface::operator=(APT::VersionContainerInterface const&)@APTPKG_6.0" 1.1~exp9 (c++)"APT::VersionContainerInterface::~VersionContainerInterface()@APTPKG_6.0" 1.1~exp9 (c++)"APT::VersionContainerInterface::VersionContainerInterface()@APTPKG_6.0" 1.1~exp9 + (c++)"APT::VersionContainerInterface::VersionContainerInterface(APT::VersionContainerInterface const&)@APTPKG_6.0" 1.9.11~ (c++)"CommandLine::CommandLine()@APTPKG_6.0" 1.1~exp9 (c++)"Configuration::FindVector(char const*, std::__cxx11::basic_string, std::allocator > const&, bool) const@APTPKG_6.0" 1.1~exp9 (c++)"debDebianSourceDirIndex::GetType() const@APTPKG_6.0" 1.1~exp9 -- cgit v1.2.3