summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-08-24 21:30:44 -0700
committerMichael Vogt <mvo@debian.org>2014-08-24 21:30:44 -0700
commit09475bebba5554481a7cb05995ded92cf30063fa (patch)
tree3ea628181ae5acd9422655094acff6811b6d2070 /apt-pkg
parentd4ab7e9c6ee81f4d81e4c3c54395fe1af4d1e7b4 (diff)
all tests pass
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-item.cc42
1 files changed, 34 insertions, 8 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index fcfdd50ea..c3b6f0e6a 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1487,6 +1487,36 @@ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)/*{{{*/
DestFile += URItoFileName(RealURI);
PartialFile = "";
+ // FIXME: duplicated code from pkgAcqMetaIndex
+ if (AuthPass == true)
+ {
+ if(FileExists(Final))
+ {
+ Status = StatTransientNetworkError;
+ _error->Warning(_("An error occurred during the signature "
+ "verification. The repository is not updated "
+ "and the previous index files will be used. "
+ "GPG error: %s: %s\n"),
+ Desc.Description.c_str(),
+ 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());
+ Status = StatError;
+ return;
+ } else {
+ _error->Warning(_("GPG error: %s: %s"),
+ Desc.Description.c_str(),
+ LookupTag(Message,"Message").c_str());
+ }
+ // gpgv method failed
+ ReportMirrorFailure("GPGFailure");
+ }
+
// FIXME: this is used often (e.g. in pkgAcqIndexTrans) so refactor
if (Cnf->LocalOnly == true ||
StringToBool(LookupTag(Message,"Transient-Failure"),false) == false)
@@ -1871,15 +1901,11 @@ bool pkgAcqMetaIndex::VerifyVendor(string Message) /*{{{*/
void pkgAcqMetaIndex::Failed(string Message,
pkgAcquire::MethodConfig * /*Cnf*/)
{
+ string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
+
if (AuthPass == true)
{
- // gpgv method failed, if we have a good signature
- string LastGoodSigFile = _config->FindDir("Dir::State::lists");
- LastGoodSigFile += URItoFileName(RealURI);
- if (DestFile != SigFile)
- LastGoodSigFile.append(".gpg");
-
- if(FileExists(LastGoodSigFile))
+ if(FileExists(Final))
{
Status = StatTransientNetworkError;
_error->Warning(_("An error occurred during the signature "
@@ -2011,8 +2037,8 @@ void pkgAcqMetaClearSig::Done(std::string Message,unsigned long long Size,
// Release/Release.gpg, see #346386
if (FileExists(DestFile) && !StartsWithGPGClearTextSignature(DestFile))
{
- //_error->Error(_("Does not start with a clear sign signature"));
pkgAcquire::Item::Failed(Message, Cnf);
+ ErrorText = _("Does not start with a cleartext signature");
return;
}
pkgAcqMetaIndex::Done(Message, Size, Hashes, Cnf);