summaryrefslogtreecommitdiff
path: root/cmdline/apt-key
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2013-08-12 00:33:37 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2013-08-12 18:01:37 +0200
commit59f46f3ace16e769383a61ee336a76c6d03931ea (patch)
treef1a9ffd209434ece61df67a5a87ba35dcac5cca3 /cmdline/apt-key
parentf9e64e7bb0c125b54f0699d9e08956a88b467a7f (diff)
do not double-slash paths in apt-key
Closes: 665411
Diffstat (limited to 'cmdline/apt-key')
-rwxr-xr-xcmdline/apt-key7
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