summaryrefslogtreecommitdiff
path: root/cmdline/apt-key.in
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-01-26 19:14:13 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-09-27 00:12:14 +0200
commit0740a31033739ba30e7cb6754111f968167cbbf5 (patch)
tree05cfc6d2534ed06b91ea2f4a62c8cc257bf91cf8 /cmdline/apt-key.in
parent93d0d08cdd6854f9bfb779c13b5b78cd6ed263aa (diff)
respect --keyring also in merged keyring commands
Git-Dch: Ignore
Diffstat (limited to 'cmdline/apt-key.in')
-rw-r--r--cmdline/apt-key.in18
1 files changed, 10 insertions, 8 deletions
diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in
index 12aee9750..c54b608e1 100644
--- a/cmdline/apt-key.in
+++ b/cmdline/apt-key.in
@@ -231,14 +231,16 @@ import_keys_from_keyring() {
}
setup_merged_keyring() {
- local TRUSTEDFILE_BAK="$TRUSTEDFILE"
- TRUSTEDFILE='/dev/null'
- foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/trusted.gpg"
- TRUSTEDFILE="$TRUSTEDFILE_BAK"
- # mark it as non-writeable so users get errors if gnupg tries to modify it
- if [ -s "${GPGHOMEDIR}/trusted.gpg" ]; then
- chmod -w "${GPGHOMEDIR}/trusted.gpg"
- GPG="$GPG --keyring ${GPGHOMEDIR}/trusted.gpg"
+ if [ -z "$FORCED_KEYRING" ]; then
+ local TRUSTEDFILE_BAK="$TRUSTEDFILE"
+ TRUSTEDFILE='/dev/null'
+ foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/pubring.gpg"
+ TRUSTEDFILE="$TRUSTEDFILE_BAK"
+ # mark it as non-writeable so users get errors if gnupg tries to modify it
+ if [ -s "${GPGHOMEDIR}/pubring.gpg" ]; then
+ chmod -w "${GPGHOMEDIR}/pubring.gpg"
+ GPG="$GPG --keyring ${GPGHOMEDIR}/pubring.gpg"
+ fi
fi
if [ -r "$TRUSTEDFILE" ]; then
GPG="$GPG --keyring $TRUSTEDFILE --primary-keyring $TRUSTEDFILE"