summaryrefslogtreecommitdiff
path: root/cmdline/apt-key
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-07-26 12:25:17 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-07-26 12:25:17 +0200
commit1a51e3db1af215ffd65ab2347baead7b1179ad80 (patch)
treea90d0a88304f7654ea494ba0fe6aa4307ef5d691 /cmdline/apt-key
parent822b344dacd3154df859ce6dbb1cb713ed96fc44 (diff)
parent27b16a2ed9a5cfdde955a0a49cd2fd73edce09c8 (diff)
merged from debian-sid
Diffstat (limited to 'cmdline/apt-key')
-rwxr-xr-xcmdline/apt-key5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmdline/apt-key b/cmdline/apt-key
index 113f9ab1b..e80741627 100755
--- a/cmdline/apt-key
+++ b/cmdline/apt-key
@@ -5,9 +5,12 @@ unset GREP_OPTIONS
# We don't use a secret keyring, of course, but gpg panics and
# implodes if there isn't one available
-GPG_CMD='gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg'
+SECRETKEYRING="$(mktemp)"
+trap "rm -f '${SECRETKEYRING}'" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
+GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring ${SECRETKEYRING}"
if [ "$(id -u)" -eq 0 ]; then
+ # we could use a tmpfile here too, but creation of this tends to be time-consuming
GPG_CMD="$GPG_CMD --trustdb-name /etc/apt/trustdb.gpg"
fi