diff options
Diffstat (limited to 'cmdline/apt-key')
-rwxr-xr-x | cmdline/apt-key | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmdline/apt-key b/cmdline/apt-key index e010e6e90..7038be265 100755 --- a/cmdline/apt-key +++ b/cmdline/apt-key @@ -203,7 +203,12 @@ if [ -z "$TRUSTEDFILE" ]; then TRUSTEDPARTS="/etc/apt/trusted.gpg.d" eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d) if [ -d "$TRUSTEDPARTS" ]; then - for trusted in $(run-parts --list $TRUSTEDPARTS --regex '^.*\.gpg$'); do + # strip / suffix as gpg will double-slash in that case (#665411) + STRIPPED_TRUSTEDPARTS="${TRUSTEDPARTS%/}" + if [ "${STRIPPED_TRUSTEDPARTS}/" = "$TRUSTEDPARTS" ]; then + TRUSTEDPARTS="$STRIPPED_TRUSTEDPARTS" + fi + for trusted in $(run-parts --list "$TRUSTEDPARTS" --regex '^.*\.gpg$'); do GPG="$GPG --keyring $trusted" done fi |