summaryrefslogtreecommitdiff
path: root/cmdline/apt-key.in
diff options
context:
space:
mode:
Diffstat (limited to 'cmdline/apt-key.in')
-rw-r--r--cmdline/apt-key.in6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in
index 99a31bdd1..dd1c52ab0 100644
--- a/cmdline/apt-key.in
+++ b/cmdline/apt-key.in
@@ -312,7 +312,7 @@ is_supported_keyring() {
return 0
fi
local FILEEXT="${1##*.}"
- if [ "$FILEEXT" = 'gpg' ]; then
+ if [ "$FILEEXT" = 'gpg' -o "$FILEEXT" = 'pub' ]; then
# 0x98, 0x99 and 0xC6 via octal as hex isn't supported by dashs printf
if printf '\231' | cmp -s -n 1 - "$1"; then
true
@@ -470,7 +470,9 @@ dearmor_filename() {
fi
}
catfile() {
- cat "$(dearmor_filename "$1")" >> "$2"
+ if accessible_file_exists "$1" && is_supported_keyring "$1"; then
+ cat "$(dearmor_filename "$1")" >> "$2"
+ fi
}
merge_all_trusted_keyrings_into_pubring() {