From e2bbdc968dc6d128ed4cb0790042a53498b690c3 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 26 Mar 2017 04:59:10 -0600 Subject: [PATCH] SC2162: read without -r mangle backslashes --- plugins/common/functions | 2 +- plugins/ssh-keys/functions | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/common/functions b/plugins/common/functions index b14820b7b..30475ba6f 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -367,7 +367,7 @@ get_cmd_from_procfile() { if [[ -f $DOKKU_PROCFILE ]]; then local line; local name; local command - while read line || [[ -n "$line" ]]; do + while read -r line || [[ -n "$line" ]]; do if [[ -z "$line" ]] || [[ "$line" == "#"* ]]; then continue fi diff --git a/plugins/ssh-keys/functions b/plugins/ssh-keys/functions index f45dce1ff..2d5d1ebf0 100755 --- a/plugins/ssh-keys/functions +++ b/plugins/ssh-keys/functions @@ -13,7 +13,7 @@ verify_ssh_key_file() { declare desc="Test that public key is valid" [[ -s ${DOKKU_ROOT}/.ssh/authorized_keys ]] || dokku_log_fail "No public keys found." local key line=0 - while read key ; do + while read -r key; do line=$((line + 1)) ssh-keygen -l -f /dev/stdin <<< "$key" &> /dev/null || dokku_log_fail "${DOKKU_ROOT}/.ssh/authorized_keys line $line failed ssh-keygen check." done <"${DOKKU_ROOT}/.ssh/authorized_keys"