From: David Kalnischkies Date: Sun, 11 Aug 2013 22:33:37 +0000 (+0200) Subject: do not double-slash paths in apt-key X-Git-Tag: 0.9.10~5 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/59f46f3ace16e769383a61ee336a76c6d03931ea?ds=sidebyside do not double-slash paths in apt-key Closes: 665411 --- 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