summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-get-install-deb
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-11-18 19:31:40 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2015-11-19 16:46:29 +0100
commit514a25cbcd2babb2a9c4485fc7b9a4256b7f6ff3 (patch)
treed0e2e2a3d5697e958cd120d87e1cd04219df946a /test/integration/test-apt-get-install-deb
parent671a55ba455dcf4e5ce6d86b202761666f54d5c6 (diff)
do not use _apt for file/copy sources if it isn't world-accessible
In 0940230d we started dropping privileges for file (and a bit later for copy, too) with the intend of uniforming this for all methods. The commit message says that the source will likely fail based on the compressors already – and there isn't much secret in the repository content. After all, after apt has run the update everyone can access the content via apt anyway… There are sources through which worked before which are mostly single-deb (and those with the uncompressed files available). The first one being especially surprising for users maybe, so instead of failing, we make it so that apt detects that it can't access a source as _apt and if so doesn't drop (for all sources!) privileges – but we limit this to file/copy, so the uncompress which might be needed will still fail – but that failed before this regression. We display a notice about this, mostly so that if it still fails (e.g. compressed) the user has some idea what is wrong. Closes: 805069
Diffstat (limited to 'test/integration/test-apt-get-install-deb')
-rwxr-xr-xtest/integration/test-apt-get-install-deb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/integration/test-apt-get-install-deb b/test/integration/test-apt-get-install-deb
index c41713a92..3f1aee5a0 100755
--- a/test/integration/test-apt-get-install-deb
+++ b/test/integration/test-apt-get-install-deb
@@ -103,3 +103,14 @@ createpkg 'trailing-newline' '' '
testsuccess aptget install ./incoming/pkg-as-it-should-be_0_all.deb
testsuccess aptget install ./incoming/pkg-leading-newline_0_all.deb
testsuccess aptget install ./incoming/pkg-trailing-newline_0_all.deb
+
+# see if permission dropping is checked before usage
+if [ "$(id -u)" = '0' ]; then
+ apt clean
+ chmod 711 ./incoming
+ testsuccess aptget install -y --allow-downgrades ./incoming/pkg-as-it-should-be_0_all.deb -q=0
+ chmod 710 ./incoming
+ testsuccesswithnotice aptget install -y --allow-downgrades ./incoming/pkg-as-it-should-be_0_all.deb -q=0
+ chmod 700 ./incoming
+ testsuccesswithnotice aptget install -y --allow-downgrades ./incoming/pkg-as-it-should-be_0_all.deb -q=0
+fi