apt-key cannot handle spaces in --keyring filename
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Debian) |
New
|
Undecided
|
Unassigned | ||
apt (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Any apt-key command with a keyring option with a space fails:
$ apt-key --keyring /mnt/sec-
usage: gpg [options] [filename]
[ 2:35PM 10435 ] [ bdmurray@
$ apt-key --keyring /mnt/sec-
Executing: gpg --ignore-
usage: gpg [options] [filename]
This is because gpg isn't passed the keyring file name with the space. Below we can see apt-key create a folder named foo instead of using the passed "foo bar".
$ apt-key --keyring /tmp/foo\ bar adv --keyserver hkp://keyserver
Executing: gpg --ignore-
gpg: keyring `/tmp/foo' created
usage: gpg [options] [filename]
tags: | added: usability |
This is due to the way that gpg is called from apt-key:
--keyring)
TRUSTEDFILE= "$1"
FORCED_ KEYRING= "$1"
GPG= "$GPG --keyring $TRUSTEDFILE --primary-keyring $TRUSTEDFILE"
shift
if [ -r "$TRUSTEDFILE" ] || [ "$2" = 'add' ] || [ "$2" = 'adv' ]; then