From 4b6a5ae1599807d60568bb617483ffe368745ac0 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 20 Sep 2011 19:35:11 -0500 Subject: 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 --- scripts/pacman-key.sh.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in index 2a78803b..b3f5259e 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 } -- cgit v1.2.3-70-g09d2