summaryrefslogtreecommitdiff
path: root/apt-pkg/indexrecords.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2013-04-30 10:44:16 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2013-04-30 10:44:16 +0200
commit3599bca5211077f5456a40adb5cec1bcbee8c3ae (patch)
tree221627b7ef4e3d6d294fbaaab425f2400734bd93 /apt-pkg/indexrecords.cc
parent6029901a2cf49aac035590960d84572b56f28933 (diff)
parentb5595da902e62af7c295f1603ae5b43ba4cef281 (diff)
merged from the debian-sid branch
Diffstat (limited to 'apt-pkg/indexrecords.cc')
-rw-r--r--apt-pkg/indexrecords.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc
index af2639beb..e37a78cfb 100644
--- a/apt-pkg/indexrecords.cc
+++ b/apt-pkg/indexrecords.cc
@@ -12,6 +12,7 @@
#include <apt-pkg/configuration.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashes.h>
+#include <apt-pkg/gpgv.h>
#include <sys/stat.h>
#include <clocale>
@@ -57,7 +58,10 @@ bool indexRecords::Exists(string const &MetaKey) const
bool indexRecords::Load(const string Filename) /*{{{*/
{
- FileFd Fd(Filename, FileFd::ReadOnly);
+ FileFd Fd;
+ if (OpenMaybeClearSignedFile(Filename, Fd) == false)
+ return false;
+
pkgTagFile TagFile(&Fd, Fd.Size() + 256); // XXX
if (_error->PendingError() == true)
{
@@ -173,7 +177,7 @@ bool indexRecords::parseSumData(const char *&Start, const char *End, /*{{{*/
Hash = "";
Size = 0;
/* Skip over the first blank */
- while ((*Start == '\t' || *Start == ' ' || *Start == '\n')
+ while ((*Start == '\t' || *Start == ' ' || *Start == '\n' || *Start == '\r')
&& Start < End)
Start++;
if (Start >= End)
@@ -215,7 +219,8 @@ bool indexRecords::parseSumData(const char *&Start, const char *End, /*{{{*/
EntryEnd = Start;
/* Find the end of the third entry (the filename) */
- while ((*EntryEnd != '\t' && *EntryEnd != ' ' && *EntryEnd != '\n')
+ while ((*EntryEnd != '\t' && *EntryEnd != ' ' &&
+ *EntryEnd != '\n' && *EntryEnd != '\r')
&& EntryEnd < End)
EntryEnd++;