]> git.saurik.com Git - apt.git/commitdiff
Test if TMPDIR is a directory in apt-key and if not unset it
authorMichael Vogt <mvo@debian.org>
Mon, 29 Sep 2014 09:43:37 +0000 (11:43 +0200)
committerMichael Vogt <mvo@debian.org>
Mon, 29 Sep 2014 09:43:37 +0000 (11:43 +0200)
This prevents a failure in mktemp -d - it will blindly trust
TMPDIR and not use something else if the dir is not there.

cmdline/apt-key.in
test/integration/test-bug-728500-tempdir

index 83a7a31b9b9c8295e341b7414c430c1ab6e7a302..7a3852ee89584472382b78c1f5299dde284f5230 100644 (file)
@@ -384,6 +384,9 @@ if [ "$command" != "help" ]; then
 
     # gpg needs (in different versions more or less) files to function correctly,
     # so we give it its own homedir and generate some valid content for it
+    if [ ! -d "$TMPDIR" ]; then
+        unset TMPDIR
+    fi
     GPGHOMEDIR="$(mktemp -d)"
     CURRENTTRAP="${CURRENTTRAP} rm -rf '${GPGHOMEDIR}';"
     trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
index 0451fc1ed97ca3e0d11fbef4800b38caa85e1c6a..bdc38c3ca9edce71a2f0a0604e1778f8b9a46063 100755 (executable)
@@ -27,3 +27,4 @@ fi
 unset TMPDIR
 
 testequal 'coolstuff' aptcache pkgnames
+testsuccess ls rootdir/var/lib/apt/lists/*InRelease