summaryrefslogtreecommitdiffstats
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2020-06-09 03:59:18 +0200
committerAndrew Gregory <andrew@archlinux.org>2020-06-18 11:07:14 +0200
commit2a345604cd8bd6a8fe5041ea7ec046c8d20aa30b (patch)
treedeb276935c35d37643b0437554637e801735a843 /scripts/makepkg.sh.in
parentf4da297de252dcb00e6c83df00fea11c86606348 (diff)
downloadpacman-2a345604cd8bd6a8fe5041ea7ec046c8d20aa30b.tar.gz
pacman-2a345604cd8bd6a8fe5041ea7ec046c8d20aa30b.tar.xz
makepkg/repo-add: handle GPGKEY with spaces
We pass this to gpg -u and this gpg option can accept a number of different formats, not just the historical hexadecimal fingerprint we assumed. We should not barf hard if a format is used which happens to contain spaces. This also fixes a validation bug. When we initially check if the desired key is available, we don't quote spaces, so gpg goes ahead and treats each space-separated string as a *different key* to search for, returning partial matches, and returning success if at least one key is found. But gpg --detach-sign -u will certainly not accept multiple keys! Fixes FS#66949 Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> (cherry picked from commit 899d39b635d46f9e2daff1aada75ea07f08fef64)
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 2c8d8673..703eb52e 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1284,7 +1284,7 @@ fi
# check if gpg signature is to be created and if signing key is valid
if { [[ -z $SIGNPKG ]] && check_buildenv "sign" "y"; } || [[ $SIGNPKG == 'y' ]]; then
SIGNPKG='y'
- if ! gpg --list-key ${GPGKEY} &>/dev/null; then
+ if ! gpg --list-key ${GPGKEY:+"$GPGKEY"} &>/dev/null; then
if [[ ! -z $GPGKEY ]]; then
error "$(gettext "The key %s does not exist in your keyring.")" "${GPGKEY}"
else