]> git.saurik.com Git - apt.git/commitdiff
update test/integration/test-releasefile-verification
authorMichael Vogt <mvo@ubuntu.com>
Wed, 1 Oct 2014 12:06:01 +0000 (14:06 +0200)
committerMichael Vogt <mvo@ubuntu.com>
Wed, 1 Oct 2014 12:06:01 +0000 (14:06 +0200)
apt-pkg/acquire-item.cc
test/integration/test-releasefile-verification

index 93ba098ee90a5712aba683a66e0ac083bbb9a6f3..4ab4ef6a117852775e640a127e65a74211663d27 100644 (file)
@@ -1623,7 +1623,15 @@ void pkgAcqMetaSig::Done(string Message,unsigned long long Size, HashStringList
 void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)/*{{{*/
 {
    string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
 void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)/*{{{*/
 {
    string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
-   
+
+   // FIXME: duplicated code from pkgAcqMetaIndex
+   if (AuthPass == true)
+   {
+      bool Stop = GenerateAuthWarning(RealURI, Message);
+      if(Stop)
+         return;
+   }
+
    // FIXME: meh, this is not really elegant
    string InReleaseURI = RealURI.replace(RealURI.rfind("Release.gpg"), 12,
                                          "InRelease");
    // FIXME: meh, this is not really elegant
    string InReleaseURI = RealURI.replace(RealURI.rfind("Release.gpg"), 12,
                                          "InRelease");
@@ -1658,14 +1666,6 @@ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)/*{{{*/
    DestFile += URItoFileName(RealURI);
    TransactionManager->TransactionStageRemoval(this, DestFile);
 
    DestFile += URItoFileName(RealURI);
    TransactionManager->TransactionStageRemoval(this, DestFile);
 
-   // FIXME: duplicated code from pkgAcqMetaIndex
-   if (AuthPass == true)
-   {
-      bool Stop = GenerateAuthWarning(RealURI, Message);
-      if(Stop)
-         return;
-   }
-
    // only allow going further if the users explicitely wants it
    if(_config->FindB("Acquire::AllowInsecureRepositories") == true)
    {
    // only allow going further if the users explicitely wants it
    if(_config->FindB("Acquire::AllowInsecureRepositories") == true)
    {
index e558b83e8384fa639a3fd9666b7c6fc197aa8368..3765a4b1f42071a40c552789649d40705e62c770 100755 (executable)
@@ -235,10 +235,21 @@ runtest2() {
 " aptcache show apt
        failaptnew
 }
 " aptcache show apt
        failaptnew
 }
-runtest2
 
 
+# diable some protection by default and ensure we still do the verification
+# correctly
+cat > rootdir/etc/apt/apt.conf.d/weaken-security <<EOF
+Acquire::AllowInsecureRepositories "1";
+Acquire::AllowDowngradeToInsecureRepositories "1";
+EOF
+
+msgmsg "Runing base test"
+runtest2
 
 DELETEFILE="InRelease"
 
 DELETEFILE="InRelease"
+msgmsg "Running test with deletion of $DELETEFILE"
 runtest
 runtest
+
 DELETEFILE="Release.gpg"
 DELETEFILE="Release.gpg"
+msgmsg "Running test with deletion of $DELETEFILE"
 runtest
 runtest