X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/cf4904e1e0019fc09b9c53b587f5f4361ed26ec7..0b7d641cf12761c3dcc5edb4031adfc9709963e4:/cmdline/apt-key diff --git a/cmdline/apt-key b/cmdline/apt-key index 843163f82..e632be706 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