FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 09-21-2011, 03:18 PM
Dan McGee
 
Default pacman-key: ensure array iterations are quoted

When doing something like `pacman-key --edit-key 'Dan McGee'`, one would
expect it to work, and not fail.

Signed-off-by: Dan McGee <dan@archlinux.org>
---
scripts/pacman-key.sh.in | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in
index 2a78803..b3f5259 100644
--- a/scripts/pacman-key.sh.in
+++ b/scripts/pacman-key.sh.in
@@ -203,7 +203,7 @@ verify_keyring_input() {
# Verify signatures of keyring files and association revocation files if they exist
msg "$(gettext "Verifying keyring file signatures...")"
local keyring
- for keyring in ${KEYRINGIDS[@]}; do
+ for keyring in "${KEYRINGIDS[@]}"; do
if ! "${GPG_PACMAN[@]}" --verify "${KEYRING_IMPORT_DIR}/${keyring}.gpg.sig" &>/dev/null; then
error "$(gettext "The signature of file %s is not valid.")" "${ADDED_KEYS}"
ret=1
@@ -239,7 +239,7 @@ populate_keyring() {
fi
else
# verify listed keyrings exist
- for keyring in ${KEYRINGIDS[@]}; do
+ for keyring in "${KEYRINGIDS[@]}"; do
if [[ ! -f "$KEYRING_IMPORT_DIR/$keyring.gpg" ]]; then
error "$(gettext "The keyring file %s does not exist.")" "$KEYRING_IMPORT_DIR/$keyring.gpg"
ret=1
@@ -258,7 +258,7 @@ populate_keyring() {
local key_id

# Add keys from requested keyrings
- for keyring in ${KEYRINGIDS[@]}; do
+ for keyring in "${KEYRINGIDS[@]}"; do
msg "$(gettext "Appending keys from %s.gpg...")" "$keyring"
local add_keys="$("${GPG_NOKEYRING[@]}" --keyring "${KEYRING_IMPORT_DIR}/${keyring}.gpg" --with-colons --list-keys | grep ^pub | cut -d: -f5)"
for key_id in ${add_keys}; do
@@ -270,7 +270,7 @@ populate_keyring() {
# to key ids is important, because key ids are the only guarantee of identification
# for the keys.
local -A removed_ids
- for keyring in ${KEYRINGIDS[@]}; do
+ for keyring in "${KEYRINGIDS[@]}"; do
if [[ -f "${KEYRING_IMPORT_DIR}/${keyring}-revoked" ]]; then
while read key; do
local key_values name
@@ -313,7 +313,7 @@ populate_keyring() {

edit_keys() {
local errors=0;
- for key in ${KEYIDS[@]}; do
+ for key in "${KEYIDS[@]}"; do
# Verify if the key exists in pacman's keyring
if ! "${GPG_PACMAN[@]}" --list-keys "$key" &>/dev/null; then
error "$(gettext "The key identified by %s does not exist")" "$key"
@@ -322,7 +322,7 @@ edit_keys() {
done
(( errors )) && exit 1;

- for key in ${KEYIDS[@]}; do
+ for key in "${KEYIDS[@]}"; do
"${GPG_PACMAN[@]}" --edit-key "$key"
done
}
--
1.7.6.3
 

Thread Tools




All times are GMT. The time now is 09:42 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org