summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-08-31 11:00:12 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-08-31 11:00:12 +0200
commit7c8206bf26b8ef6020b543bbc027305dee8f2308 (patch)
tree0a2df6cb2f5979735a9532ea61e11fa2207793f4 /test
parentdd6da7d2392e2ad35c444ebc2d7bc2308380530c (diff)
if file is inaccessible for _apt, disable privilege drop in acquire
We had a very similar method previously for our own private usage, but with some generalisation we can move this check into the acquire system proper so that all frontends profit from this compatibility change. As we are disabling a security feature here a warning is issued and frontends are advised to consider reworking their download logic if possible. Note that this is implemented as an all or nothing situation: We can't just (not) drop privileges for a subset of the files in a fetcher, so in case you have to download some files with and some without you need to use two fetchers.
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-acquire-same-file-multiple-times3
-rwxr-xr-xtest/integration/test-apt-get-changelog8
2 files changed, 7 insertions, 4 deletions
diff --git a/test/integration/test-acquire-same-file-multiple-times b/test/integration/test-acquire-same-file-multiple-times
index 526765521..a850f897c 100755
--- a/test/integration/test-acquire-same-file-multiple-times
+++ b/test/integration/test-acquire-same-file-multiple-times
@@ -14,10 +14,9 @@ filedown() {
msgtest 'Downloading the same URI twice over file' "$1"
testsuccess --nomsg apthelper download-file file:///$APTARCHIVE/foo ./downloaded/foo1 '' file:///$APTARCHIVE/foo ./downloaded/foo2 '' -o Debug::pkgAcquire::Worker=1
cp rootdir/tmp/testsuccess.output download.log
- #cat download.log
testsuccess cmp $TESTFILE ./downloaded/foo1
testsuccess cmp ./downloaded/foo1 ./downloaded/foo2
- #testequal '1' grep -c '200%20URI%20Start' ./download.log
+ testequal '1' grep -c '200%20URI%20Start' ./download.log
testequal '1' grep -c '201%20URI%20Done' ./download.log
rm -f ./downloaded/foo1 ./downloaded/foo2
}
diff --git a/test/integration/test-apt-get-changelog b/test/integration/test-apt-get-changelog
index 6ca05d0fa..502920617 100755
--- a/test/integration/test-apt-get-changelog
+++ b/test/integration/test-apt-get-changelog
@@ -47,8 +47,12 @@ testsuccessequal "'http://localhost:8080/main/f/foo/foo_1.0.changelog' foo.chang
'http://localhost:8080/main/libb/libbar/libbar_1.0.changelog' libbar.changelog" aptget changelog foo libbar --print-uris -o Acquire::Changelogs::URI::Override::Label::Debian='http://localhost:8080/CHANGEPATH.changelog'
releasechanger 'Changelogs' 'no'
-testequal 'E: Failed to fetch changelog:/foo.changelog Changelog unavailable for foo=1.0
-' aptget changelog foo -qq -d
+if [ "$(id -u)" = '0' ]; then
+ testfailuremsg "W: Can't drop privileges for downloading as file 'foo.changelog' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
+E: Failed to fetch changelog:/foo.changelog Changelog unavailable for foo=1.0" aptget changelog foo -d
+else
+ testfailuremsg 'E: Failed to fetch changelog:/foo.changelog Changelog unavailable for foo=1.0' aptget changelog foo -d
+fi
sed -i '/^Changelogs: / d' $(find rootdir/var/lib/apt/lists -name '*Release')
releasechanger 'Label' 'Testcases'