You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
1.0 KiB

  1. #!/bin/sh
  2. #
  3. # Ensure that we do not modify file:/// uris (regression test for
  4. # CVE-2014-0487
  5. #
  6. set -e
  7. TESTDIR=$(readlink -f $(dirname $0))
  8. . $TESTDIR/framework
  9. setupenvironment
  10. configarchitecture "amd64"
  11. configcompression 'bz2' 'gz'
  12. insertpackage 'unstable' 'foo' 'all' '1'
  13. insertsource 'unstable' 'foo' 'all' '1'
  14. setupaptarchive --no-update
  15. # ensure the archive is not writable
  16. addtrap 'prefix' 'chmod 750 aptarchive/dists/unstable/main/binary-amd64;'
  17. chmod 550 aptarchive/dists/unstable/main/binary-amd64
  18. testsuccess aptget update
  19. testsuccess aptget update -o Debug::pkgAcquire::Auth=1
  20. cp -a rootdir/tmp/testsuccess.output rootdir/tmp/update.output
  21. # ensure that the hash of the uncompressed file was verified even on a local ims hit
  22. canary="SHA512:$(bzcat aptarchive/dists/unstable/main/binary-amd64/Packages.bz2 | sha512sum |cut -f1 -d' ')"
  23. testsuccess grep -- "$canary" rootdir/tmp/update.output
  24. # foo is still available
  25. testsuccess aptget install -s foo
  26. testsuccess aptcache showsrc foo
  27. testsuccess aptget source foo --print-uris