From: Michael Vogt Date: Tue, 28 Jun 2011 14:49:45 +0000 (+0100) Subject: merged from donkult X-Git-Tag: 0.8.15~4 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/f1ffbc5001afa705e347dcdbcda1c8a54a90372b?hp=aa833344f36bb81fb79c9d1dbe8f9240a00fc645 merged from donkult --- diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 6785b4e1b..c3817f6ee 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -271,6 +271,14 @@ void pkgAcqSubIndex::Done(string Message,unsigned long Size,string Md5Hash, /*{{ string FinalFile = _config->FindDir("Dir::State::lists")+URItoFileName(Desc.URI); + /* Downloaded invalid transindex => Error (LP: #346386) (Closes: #627642) */ + indexRecords SubIndexParser; + if (FileExists(DestFile) == true && !SubIndexParser.Load(DestFile)) { + Status = StatError; + ErrorText = SubIndexParser.ErrorText; + return; + } + // sucess in downloading the index // rename the index if(Debug) @@ -894,6 +902,30 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string Hash, ReportMirrorFailure("HashChecksumFailure"); return; } + + /* Verify the index file for correctness (all indexes must + * have a Package field) (LP: #346386) (Closes: #627642) */ + { + FileFd fd(DestFile, FileFd::ReadOnly); + pkgTagSection sec; + pkgTagFile tag(&fd); + + // Only test for correctness if the file is not empty (empty is ok) + if (fd.Size() > 0) { + if (_error->PendingError() || !tag.Step(sec)) { + Status = StatError; + _error->DumpErrors(); + Rename(DestFile,DestFile + ".FAILED"); + return; + } else if (!sec.Exists("Package")) { + Status = StatError; + ErrorText = ("Encountered a section with no Package: header"); + Rename(DestFile,DestFile + ".FAILED"); + return; + } + } + } + // Done, move it into position string FinalFile = _config->FindDir("Dir::State::lists"); FinalFile += URItoFileName(RealURI); @@ -1330,6 +1362,16 @@ void pkgAcqMetaIndex::AuthDone(string Message) /*{{{*/ /*}}}*/ void pkgAcqMetaIndex::QueueIndexes(bool verify) /*{{{*/ { +#if 0 + /* Reject invalid, existing Release files (LP: #346386) (Closes: #627642) + * FIXME: Disabled; it breaks unsigned repositories without hashes */ + if (!verify && FileExists(DestFile) && !MetaIndexParser->Load(DestFile)) + { + Status = StatError; + ErrorText = MetaIndexParser->ErrorText; + return; + } +#endif for (vector ::const_iterator Target = IndexTargets->begin(); Target != IndexTargets->end(); Target++) @@ -1493,6 +1535,12 @@ void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) LookupTag(Message,"Message").c_str()); RunScripts("APT::Update::Auth-Failure"); return; + } else if (LookupTag(Message,"Message").find("NODATA") != string::npos) { + /* Invalid signature file, reject (LP: #346386) (Closes: #627642) */ + _error->Error(_("GPG error: %s: %s"), + Desc.Description.c_str(), + LookupTag(Message,"Message").c_str()); + return; } else { _error->Warning(_("GPG error: %s: %s"), Desc.Description.c_str(), diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc index ba43bc757..19661fc2d 100644 --- a/apt-pkg/orderlist.cc +++ b/apt-pkg/orderlist.cc @@ -1073,6 +1073,12 @@ bool pkgOrderList::CheckDep(DepIterator D) just needs one */ if (D.IsNegative() == false) { + // ignore provides by older versions of this package + if (((D.Reverse() == false && Pkg == D.ParentPkg()) || + (D.Reverse() == true && Pkg == D.TargetPkg())) && + Cache[Pkg].InstallVer != *I) + continue; + /* Try to find something that does not have the after flag set if at all possible */ if (IsFlag(Pkg,After) == true) diff --git a/debian/changelog b/debian/changelog index 971cf53b7..c8a4f4477 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ apt (0.8.14.2) UNRELEASED; urgency=low * apt-pkg/depcache.cc: - Really release action groups only once (Closes: #622744) - Make purge work again for config-files (LP: #244598) (Closes: #150831) + * apt-pkg/acquire-item.cc: + - Reject files known to be invalid (LP: #346386) (Closes: #627642) * debian/apt.cron.daily: - Check power after wait, patch by manuel-soto (LP: #705269) * debian/control: @@ -14,6 +16,9 @@ apt (0.8.14.2) UNRELEASED; urgency=low [ Christian Perrier ] * Galician translation update (Miguel Anxo Bouzada). Closes: #626505 + * Italian translation update (Milo Casagrande). Closes: #627834 + * German documentation translation update (Chris Leick). Closes: #629949 + * Catalan translation update (Jordi Mallach). Closes: #630657 [ David Kalnischkies ] * fix a bunch of cppcheck warnings/errors based on a patch by @@ -77,6 +82,9 @@ apt (0.8.14.2) UNRELEASED; urgency=low * cmdline/apt-config.cc: - show Acquire::Languages and APT::Architectures settings in 'dump' (Closes: 626739) + * apt-pkg/orderlist.cc: + - ensure that an old version of a package with a provides can + never satisfy a dependency of a newer version of this package -- David Kalnischkies Sat, 28 May 2011 10:54:23 +0200 diff --git a/doc/po/de.po b/doc/po/de.po index 891e69964..5cb2b708d 100644 --- a/doc/po/de.po +++ b/doc/po/de.po @@ -1,14 +1,14 @@ # Translation of apt-doc to German # Copyright (C) 1997, 1998, 1999 Jason Gunthorpe and others. # This file is distributed under the same license as the apt-doc package. -# Chris Leick , 2009, 2010. +# Chris Leick , 2009-2011. # msgid "" msgstr "" -"Project-Id-Version: apt-doc 0.7.25.3\n" +"Project-Id-Version: apt-doc 0.8.14-1\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2011-02-14 13:42+0100\n" -"PO-Revision-Date: 2010-09-16 19:04+0100\n" +"PO-Revision-Date: 2011-05-31 21:00+0100\n" "Last-Translator: Chris Leick \n" "Language-Team: German \n" "Language: de\n" @@ -656,16 +656,12 @@ msgstr "" #. The last update date #. type: Content of: #: apt-cache.8.xml:16 -#, fuzzy -#| msgid "" -#| "&apt-author.jgunthorpe; &apt-author.team; &apt-email; &apt-product; " -#| "14 February 2004" msgid "" "&apt-author.jgunthorpe; &apt-author.team; &apt-email; &apt-product; 04 " "February 2011" msgstr "" "&apt-author.jgunthorpe; &apt-author.team; &apt-email; &apt-product; " -"14. Februar 2004" +"04. Februar 2011" #. type: Content of: #: apt-cache.8.xml:25 apt-cache.8.xml:32 @@ -690,33 +686,10 @@ msgstr "APT" #. type: Content of: #: apt-cache.8.xml:33 msgid "query the APT cache" -msgstr "" +msgstr "den APT-Zwischenspeicher abfragen" #. type: Content of: #: apt-cache.8.xml:39 -#, fuzzy -#| msgid "" -#| "apt-cache " -#| " " -#| " add file gencaches " -#| "showpkg pkg showsrc pkg stats dump dumpavail unmet search regex show pkg " -#| "depends pkg rdepends pkg pkgnames prefix dotty pkg xvcg pkg policy pkgs madison pkgs " msgid "" "apt-cache