summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:54:39 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:54:39 +0000
commitb3c39978a1fcaa26ffa4904f4b012156e5d7d51c (patch)
treeab575315c8958d0496d122a3f04f1a54fc11ab18 /apt-pkg/acquire-item.cc
parent0f297e4681b834170c5eb35ccf51e51e61a4b131 (diff)
Fixed MD5 checking on source archives
Author: jgg Date: 1999-09-01 07:01:14 GMT Fixed MD5 checking on source archives
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 5dc9413a9..019fb66a9 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire-item.cc,v 1.36 1999/08/28 03:22:34 jgg Exp $
+// $Id: acquire-item.cc,v 1.37 1999/09/01 07:01:14 jgg Exp $
/* ######################################################################
Acquire Item - Item to acquire
@@ -565,7 +565,7 @@ void pkgAcqArchive::Finished()
/* The file is added to the queue */
pkgAcqFile::pkgAcqFile(pkgAcquire *Owner,string URI,string MD5,
unsigned long Size,string Dsc,string ShortDesc) :
- Item(Owner), MD5(MD5)
+ Item(Owner), Md5Hash(MD5)
{
DestFile = flNotDir(URI);
@@ -597,6 +597,18 @@ pkgAcqFile::pkgAcqFile(pkgAcquire *Owner,string URI,string MD5,
/* */
void pkgAcqFile::Done(string Message,unsigned long Size,string MD5)
{
+ // Check the md5
+ if (Md5Hash.empty() == false && MD5.empty() == false)
+ {
+ if (Md5Hash != MD5)
+ {
+ Status = StatError;
+ ErrorText = "MD5Sum mismatch";
+ Rename(DestFile,DestFile + ".FAILED");
+ return;
+ }
+ }
+
Item::Done(Message,Size,MD5);
string FileName = LookupTag(Message,"Filename");