From 154fd04e8870577626fa43546f40273f6edbc9f3 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 2 May 2012 19:20:56 +0200 Subject: * debian/libapt-inst1.5.symbols: - use the correct library name the symbols header --- debian/changelog | 4 +++- debian/libapt-inst1.5.symbols | 2 +- prepare-release | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 34d6991b5..d77de1b3a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,8 +24,10 @@ apt (0.9.3) unstable; urgency=low * edsp/edspsystem.cc: - check with RealFileExists for scenario file as otherwise a directory like one provided with RootDir triggers the usage of EDSP + * debian/libapt-inst1.5.symbols: + - use the correct library name the symbols header - -- David Kalnischkies Mon, 23 Apr 2012 22:02:58 +0200 + -- David Kalnischkies Wed, 02 May 2012 19:18:51 +0200 apt (0.9.2) unstable; urgency=low diff --git a/debian/libapt-inst1.5.symbols b/debian/libapt-inst1.5.symbols index cade0990d..8fcd29a3e 100644 --- a/debian/libapt-inst1.5.symbols +++ b/debian/libapt-inst1.5.symbols @@ -1,4 +1,4 @@ -libapt-inst.so.1.4 libapt-inst1.4 #MINVER# +libapt-inst.so.1.5 libapt-inst1.5 #MINVER# * Build-Depends-Package: libapt-pkg-dev (c++)"ExtractTar::Done(bool)@Base" 0.8.0 (c++)"ExtractTar::Go(pkgDirStream&)@Base" 0.8.0 diff --git a/prepare-release b/prepare-release index e02157b24..fd98c489f 100755 --- a/prepare-release +++ b/prepare-release @@ -4,6 +4,23 @@ VERSION=$(dpkg-parsechangelog | sed -n -e '/^Version:/s/^Version: //p') DISTRIBUTION=$(dpkg-parsechangelog | sed -n -e '/^Distribution:/s/^Distribution: //p') if [ "$1" = 'pre-export' ]; then + libraryversioncheck() { + LIBRARY="$1" + VERSION="$2" + if [ ! -e "debian/${LIBRARY}${VERSION}.symbols" ]; then + echo >&2 "Library ${LIBRARY} in version ${VERSION} has no symbols file! (maybe forgot to rename?)" + exit 1 + fi + if [ "$(head -n1 "debian/${LIBRARY}${VERSION}.symbols")" != "${LIBRARY}.so.${VERSION} ${LIBRARY}${VERSION} #MINVER#" ]; then + echo >&2 "Library ${LIBRARY}${VERSION} has incorrect version in symbol header! (»$(head -n1 "debian/${LIBRARY}${VERSION}.symbols")«)" + exit 2 + fi + } + + libraryversioncheck 'libapt-pkg' "$(awk -v ORS='.' '/^\#define APT_PKG_M/ {print $3}' apt-pkg/init.h | sed 's/\.$//')" + libraryversioncheck 'libapt-inst' "$(egrep '^MAJOR=' apt-inst/makefile |cut -d '=' -f 2)" + + if [ "$DISTRIBUTION" = 'sid' ]; then echo >&2 '»sid« is not a valid distribution. Replace it with »unstable« for you' sed -i -e 's/) sid; urgency=/) unstable; urgency=/' debian/changelog -- cgit v1.2.3 From 5954d4d2020a247d414c7e064a87f9464be85fcf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 2 May 2012 22:00:02 +0200 Subject: * apt-pkg/pkgcachegen.cc: - check if NewDescription allocation has failed and error out accordingly --- apt-pkg/pkgcachegen.cc | 6 ++++++ debian/changelog | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index ec072fddd..5e0726f3b 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -304,6 +304,9 @@ bool pkgCacheGenerator::MergeListPackage(ListParser &List, pkgCache::PkgIterator void const * const oldMap = Map.Data(); map_ptrloc const descindex = NewDescription(Desc, CurLang, CurMd5, *LastDesc); + if (unlikely(descindex == 0 && _error->PendingError())) + return _error->Error(_("Error occurred while processing %s (%s%d)"), + Pkg.Name(), "NewDescription", 1); if (oldMap != Map.Data()) LastDesc += (map_ptrloc*) Map.Data() - (map_ptrloc*) oldMap; *LastDesc = descindex; @@ -456,6 +459,9 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator oldMap = Map.Data(); map_ptrloc const descindex = NewDescription(Desc, CurLang, CurMd5, *LastDesc); + if (unlikely(descindex == 0 && _error->PendingError())) + return _error->Error(_("Error occurred while processing %s (%s%d)"), + Pkg.Name(), "NewDescription", 2); if (oldMap != Map.Data()) LastDesc += (map_ptrloc*) Map.Data() - (map_ptrloc*) oldMap; *LastDesc = descindex; diff --git a/debian/changelog b/debian/changelog index d77de1b3a..799653d5f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,8 +26,10 @@ apt (0.9.3) unstable; urgency=low like one provided with RootDir triggers the usage of EDSP * debian/libapt-inst1.5.symbols: - use the correct library name the symbols header + * apt-pkg/pkgcachegen.cc: + - check if NewDescription allocation has failed and error out accordingly - -- David Kalnischkies Wed, 02 May 2012 19:18:51 +0200 + -- David Kalnischkies Wed, 02 May 2012 21:59:02 +0200 apt (0.9.2) unstable; urgency=low -- cgit v1.2.3 From fc691496f22e75f5bbb127cf6baff793898220ca Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 2 May 2012 22:31:49 +0200 Subject: * apt-pkg/deb/deblistparser.cc: - check length and containing chars for a given description md5sum --- apt-pkg/deb/deblistparser.cc | 17 ++++++++++++----- debian/changelog | 4 +++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 00e2bd900..7bef6772c 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -215,15 +215,22 @@ string debListParser::DescriptionLanguage() */ MD5SumValue debListParser::Description_md5() { - string value = Section.FindS("Description-md5"); - - if (value.empty()) + string const value = Section.FindS("Description-md5"); + if (value.empty() == true) { MD5Summation md5; md5.Add((Description() + "\n").c_str()); return md5.Result(); - } else - return MD5SumValue(value); + } + else if (likely(value.size() == 32)) + { + if (likely(value.find_first_not_of("0123456789abcdefABCDEF") == string::npos)) + return MD5SumValue(value); + _error->Error("Malformed Description-md5 line; includes invalid character '%s'", value.c_str()); + return MD5SumValue(); + } + _error->Error("Malformed Description-md5 line; doesn't have the required length (32 != %d) '%s'", (int)value.size(), value.c_str()); + return MD5SumValue(); } /*}}}*/ // ListParser::UsePackage - Update a package structure /*{{{*/ diff --git a/debian/changelog b/debian/changelog index 799653d5f..72830ad91 100644 --- a/debian/changelog +++ b/debian/changelog @@ -28,8 +28,10 @@ apt (0.9.3) unstable; urgency=low - use the correct library name the symbols header * apt-pkg/pkgcachegen.cc: - check if NewDescription allocation has failed and error out accordingly + * apt-pkg/deb/deblistparser.cc: + - check length and containing chars for a given description md5sum - -- David Kalnischkies Wed, 02 May 2012 21:59:02 +0200 + -- David Kalnischkies Wed, 02 May 2012 22:28:32 +0200 apt (0.9.2) unstable; urgency=low -- cgit v1.2.3 From 9a4ffe576267539ae5549f0c77cc8ab37c2516fb Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 2 May 2012 23:13:26 +0200 Subject: add a simple test for HashSumValue classes --- test/libapt/hashsums_test.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/libapt/hashsums_test.cc b/test/libapt/hashsums_test.cc index 396e4cf6b..e2d0aec5b 100644 --- a/test/libapt/hashsums_test.cc +++ b/test/libapt/hashsums_test.cc @@ -42,6 +42,28 @@ template void TestMill(const char *Out) int main(int argc, char** argv) { + // test HashSumValue which doesn't calculate but just stores sums + { + string md5sum = argv[2]; + MD5SumValue md5(md5sum); + equals(md5.Value(), md5sum); + } + { + string sha1sum = argv[3]; + SHA1SumValue sha1(sha1sum); + equals(sha1.Value(), sha1sum); + } + { + string sha2sum = argv[4]; + SHA256SumValue sha2(sha2sum); + equals(sha2.Value(), sha2sum); + } + { + string sha2sum = argv[5]; + SHA512SumValue sha2(sha2sum); + equals(sha2.Value(), sha2sum); + } + // From FIPS PUB 180-1 Test("","da39a3ee5e6b4b0d3255bfef95601890afd80709"); Test("abc","a9993e364706816aba3e25717850c26c9cd0d89d"); -- cgit v1.2.3 From 7f5aab82708813d86aab04029095988f40a8462e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 5 May 2012 02:06:49 +0200 Subject: check if we work on a valid description in IsDuplicateDescription as we end up working on dangling pointers otherwise which segfaults on s390x and ppc64 (Closes: #669427) --- apt-pkg/pkgcachegen.cc | 4 ++-- debian/changelog | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 5e0726f3b..d455e4070 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -286,7 +286,7 @@ bool pkgCacheGenerator::MergeListPackage(ListParser &List, pkgCache::PkgIterator pkgCache::DescIterator Desc = Ver.DescriptionList(); // a version can only have one md5 describing it - if (MD5SumValue(Desc.md5()) != CurMd5) + if (Desc.end() == true || MD5SumValue(Desc.md5()) != CurMd5) continue; // don't add a new description if we have one for the given @@ -1459,7 +1459,7 @@ bool IsDuplicateDescription(pkgCache::DescIterator Desc, MD5SumValue const &CurMd5, std::string const &CurLang) { // Descriptions in the same link-list have all the same md5 - if (MD5SumValue(Desc.md5()) != CurMd5) + if (Desc.end() == true || MD5SumValue(Desc.md5()) != CurMd5) return false; for (; Desc.end() == false; ++Desc) if (Desc.LanguageCode() == CurLang) diff --git a/debian/changelog b/debian/changelog index 72830ad91..2c4bde370 100644 --- a/debian/changelog +++ b/debian/changelog @@ -28,10 +28,13 @@ apt (0.9.3) unstable; urgency=low - use the correct library name the symbols header * apt-pkg/pkgcachegen.cc: - check if NewDescription allocation has failed and error out accordingly + - check if we work on a valid description in IsDuplicateDescription as + we end up working on dangling pointers otherwise which segfaults on + s390x and ppc64 (Closes: #669427) * apt-pkg/deb/deblistparser.cc: - check length and containing chars for a given description md5sum - -- David Kalnischkies Wed, 02 May 2012 22:28:32 +0200 + -- David Kalnischkies Sat, 05 May 2012 02:02:41 +0200 apt (0.9.2) unstable; urgency=low -- cgit v1.2.3 From a00a9b44a1e0abf944d88c36ceaac8afdd207dcb Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 5 May 2012 15:37:31 +0200 Subject: ensure that apti18n.h is included last as advertised (Closes: #671623) --- apt-pkg/cachefilter.cc | 4 ++-- apt-pkg/packagemanager.cc | 3 ++- cmdline/apt-extracttemplates.cc | 6 ++++-- cmdline/apt-internal-solver.cc | 7 ++++--- debian/changelog | 3 ++- ftparchive/cachedb.cc | 5 +++-- ftparchive/contents.cc | 4 +++- ftparchive/override.cc | 3 ++- 8 files changed, 22 insertions(+), 13 deletions(-) diff --git a/apt-pkg/cachefilter.cc b/apt-pkg/cachefilter.cc index 9ec3fa699..fb444208c 100644 --- a/apt-pkg/cachefilter.cc +++ b/apt-pkg/cachefilter.cc @@ -10,11 +10,11 @@ #include #include -#include - #include #include + +#include /*}}}*/ namespace APT { namespace CacheFilter { diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index b56619ef5..06151a165 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -25,9 +25,10 @@ #include #include -#include #include #include + +#include /*}}}*/ using namespace std; diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc index 60efafba5..8fe15fdf9 100644 --- a/cmdline/apt-extracttemplates.cc +++ b/cmdline/apt-extracttemplates.cc @@ -36,11 +36,13 @@ #include #include #include +#include + #include -#include -#include #include "apt-extracttemplates.h" + +#include /*}}}*/ using namespace std; diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index 25ecb7af1..e7faf88a9 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -7,6 +7,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -18,11 +20,10 @@ #include #include -#include -#include - #include #include + +#include /*}}}*/ // ShowHelp - Show a help screen /*{{{*/ diff --git a/debian/changelog b/debian/changelog index 2c4bde370..8eec902d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -33,8 +33,9 @@ apt (0.9.3) unstable; urgency=low s390x and ppc64 (Closes: #669427) * apt-pkg/deb/deblistparser.cc: - check length and containing chars for a given description md5sum + * ensure that apti18n.h is included last as advertised (Closes: #671623) - -- David Kalnischkies Sat, 05 May 2012 02:02:41 +0200 + -- David Kalnischkies Sat, 05 May 2012 15:35:16 +0200 apt (0.9.2) unstable; urgency=low diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc index a8b637a80..c2318bf53 100644 --- a/ftparchive/cachedb.cc +++ b/ftparchive/cachedb.cc @@ -19,11 +19,12 @@ #include #include #include - + #include // htonl, etc -#include #include "cachedb.h" + +#include /*}}}*/ // CacheDB::ReadyDB - Ready the DB2 /*{{{*/ diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc index bbc5a1e2b..015c790e0 100644 --- a/ftparchive/contents.cc +++ b/ftparchive/contents.cc @@ -38,13 +38,15 @@ #include #include #include + #include #include #include #include -#include #include "contents.h" + +#include /*}}}*/ // GenContents::~GenContents - Free allocated memory /*{{{*/ diff --git a/ftparchive/override.cc b/ftparchive/override.cc index d363fd0fe..760c20120 100644 --- a/ftparchive/override.cc +++ b/ftparchive/override.cc @@ -12,13 +12,14 @@ // Include Files /*{{{*/ #include -#include #include #include #include #include "override.h" + +#include /*}}}*/ // Override::ReadOverride - Read the override file /*{{{*/ -- cgit v1.2.3