summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-update-file
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-10-27 15:57:12 +0100
committerMichael Vogt <mvo@ubuntu.com>2014-10-27 15:57:12 +0100
commite29a7a394cfd41e8bad81535e0a8c07654f34bf6 (patch)
treec317e2f45aa1c96300028fb830555f248db5771e /test/integration/test-apt-update-file
parentbc5095b7d708c7e376f98be6edc2ad7cceca57ed (diff)
parent28460cb27846b2437010b08adf10bde18e370974 (diff)
Merge remote-tracking branch 'upstream/debian/sid' into debian/sid
Diffstat (limited to 'test/integration/test-apt-update-file')
-rwxr-xr-xtest/integration/test-apt-update-file36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/integration/test-apt-update-file b/test/integration/test-apt-update-file
new file mode 100755
index 000000000..fbcd473cc
--- /dev/null
+++ b/test/integration/test-apt-update-file
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Ensure that we do not modify file:/// uris (regression test for
+# CVE-2014-0487
+#
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "amd64"
+configcompression 'bz2' 'gz'
+
+insertpackage 'unstable' 'foo' 'all' '1.0'
+
+umask 022
+setupaptarchive --no-update
+
+# ensure the archive is not writable
+chmod 550 aptarchive/dists/unstable/main/binary-amd64
+
+testsuccess aptget update -qq
+testsuccess aptget update -qq
+aptget update -qq -o Debug::pkgAcquire::Auth=1 2> output.log
+
+# ensure that the hash of the uncompressed file was verified even on a local
+# ims hit
+canary="SHA512:$(bzcat aptarchive/dists/unstable/main/binary-amd64/Packages.bz2 | sha512sum |cut -f1 -d' ')"
+grep -q "RecivedHash: $canary" output.log
+
+# foo is still available
+testsuccess aptget install -s foo
+
+# the cleanup should still work
+chmod 750 aptarchive/dists/unstable/main/binary-amd64