Explorar o código

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.
David Kalnischkies %!s(int64=10) %!d(string=hai) anos
pai
achega
5da51e0e2d
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      apt-pkg/deb/debrecords.cc

+ 3 - 0
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;
 }
 									/*}}}*/