summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-06-18 16:27:04 +0200
committerJulian Andres Klode <jak@debian.org>2016-06-22 14:16:39 +0200
commit7090944aa01bb8e9d83b6319a4e427fe7090b672 (patch)
tree3b1dff7baf62d13d8560790db0414df47f7cd085
parent6fabf3723c40b2b1ad47e2e003f934f81562da67 (diff)
ensure filesize of deb is included in the hashes list
Filesize is a silly hash all by itself, but in combination with others it can be a strong opponent, so ensuring that it is in the list of hashes and hence checked by the normal course of action the acquire process takes is a good thing. (cherry picked from commit 5da51e0e2da3f055306562d38103b06a23d81719)
-rw-r--r--apt-pkg/deb/debrecords.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc
index beaa83bd9..a132f34a6 100644
--- a/apt-pkg/deb/debrecords.cc
+++ b/apt-pkg/deb/debrecords.cc
@@ -90,6 +90,9 @@ HashStringList debRecordParserBase::Hashes() const
if (hash.empty() == false)
hashes.push_back(HashString(*type, hash));
}
+ auto const size = Section.FindULL("Size", 0);
+ if (size != 0)
+ hashes.FileSize(size);
return hashes;
}
/*}}}*/