test-security-no-remote-status 751 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. #
  3. # Test that packages from remote sources cannot set the Status field.
  4. #
  5. set -e
  6. TESTDIR="$(readlink -f "$(dirname "$0")")"
  7. . "$TESTDIR/framework"
  8. setupenvironment
  9. configarchitecture 'amd64'
  10. TMPDIR=$(readlink -f .)
  11. insertpackage 'unstable' 'pretends-installed' 'all' '1' 'Status: install ok installed'
  12. insertinstalledpackage 'really-installed' 'all' '1'
  13. setupaptarchive
  14. testequal "pretends-installed:
  15. Installed: (none)
  16. Candidate: 1
  17. Version table:
  18. 1 500
  19. 500 file:${TMPDIR}/aptarchive unstable/main all Packages" aptcache policy pretends-installed
  20. testequal "really-installed:
  21. Installed: 1
  22. Candidate: 1
  23. Version table:
  24. *** 1 100
  25. 100 ${TMPDIR}/rootdir/var/lib/dpkg/status" aptcache policy really-installed