summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2022-10-31 10:43:17 +0000
committerJulian Andres Klode <jak@debian.org>2022-10-31 10:43:17 +0000
commitbee0cd79c1b8d1f1104d9bce28015948d1da0ba6 (patch)
treee140ea270163cf26dff640754ed2a7ae0f8b8ed4
parent3180d0817f2cab341d3972538cdfdc8fc7ea9363 (diff)
parentc2cb1e42189c5fe3481386cb83a6b03bfe583d1f (diff)
Merge branch 'pu/clean-apt-key-tmp' into 'main'
Actually delete temporary apt-key.*.asc helper files See merge request apt-team/apt!266
-rw-r--r--methods/gpgv.cc2
-rwxr-xr-xtest/integration/test-signed-by-option5
2 files changed, 6 insertions, 1 deletions
diff --git a/methods/gpgv.cc b/methods/gpgv.cc
index b8d348484..267b43e08 100644
--- a/methods/gpgv.cc
+++ b/methods/gpgv.cc
@@ -482,7 +482,7 @@ bool GPGVMethod::URIAcquire(std::string const &Message, FetchItem *Itm)
struct TemporaryFile
{
std::string name = "";
- ~TemporaryFile() { if (0) RemoveFile("~TemporaryFile", name); }
+ ~TemporaryFile() { RemoveFile("~TemporaryFile", name); }
} tmpKey;
std::string SignedBy = DeQuoteString(LookupTag(Message, "Signed-By"));
diff --git a/test/integration/test-signed-by-option b/test/integration/test-signed-by-option
index 986088bce..58e4c4b19 100755
--- a/test/integration/test-signed-by-option
+++ b/test/integration/test-signed-by-option
@@ -7,6 +7,9 @@ TESTDIR="$(readlink -f "$(dirname "$0")")"
setupenvironment
configarchitecture 'amd64'
+export TMPDIR="${TMPWORKINGDIRECTORY}/tmp"
+mkdir "${TMPDIR}"
+
msgtest 'Check that a repository with' 'signed-by and two components works'
echo 'deb [signed-by=CDE5618B8805FD6E202CE9C2D73C39E56580B386] https://people.debian.org/~jak/debian/ stable main contrib # Äffchen' > rootdir/etc/apt/sources.list
testsuccess --nomsg aptcache policy
@@ -66,3 +69,5 @@ testfailure apt update -o Debug::Acquire::gpgv=1
testsuccess grep "NO_PUBKEY 5A90D141DBAC8DAE" rootdir/tmp/testfailure.output
sed -i s/^xSigned-By/Signed-By/ rootdir/etc/apt/sources.list.d/deb822.sources
testsuccess apt update -o Debug::Acquire::gpgv=1
+# make sure we did not leave leftover files (LP: #1995247)
+testsuccessequal "" ls "${TMPDIR}"