diff options
author | Matt Corallo <git@bluematt.me> | 2017-12-05 15:21:23 -0500 |
---|---|---|
committer | Matt Corallo <git@bluematt.me> | 2017-12-05 15:21:23 -0500 |
commit | a38686cea035e0d480e4ee953b8e40c7f0fa2118 (patch) | |
tree | ecacfbc7f9c2f96618908a80ae8654b884b705eb | |
parent | 91eeaa03354bbb4ee79d6defaffaef2b32ecbe29 (diff) | |
download | bitcoin-a38686cea035e0d480e4ee953b8e40c7f0fa2118.tar.xz |
[verify-commits] Fix gpg.sh's echoing for commits with '\n'
-rwxr-xr-x | contrib/verify-commits/gpg.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/verify-commits/gpg.sh b/contrib/verify-commits/gpg.sh index abd8f5fd9f..8f3e4b8063 100755 --- a/contrib/verify-commits/gpg.sh +++ b/contrib/verify-commits/gpg.sh @@ -9,7 +9,7 @@ REVSIG=false IFS=' ' if [ "$BITCOIN_VERIFY_COMMITS_ALLOW_SHA1" = 1 ]; then - GPG_RES="$(echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)" + GPG_RES="$(printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)" else # Note how we've disabled SHA1 with the --weak-digest option, disabling # signatures - including selfsigs - that use SHA1. While you might think that @@ -24,7 +24,7 @@ else case "$LINE" in "gpg (GnuPG) 1.4.1"*|"gpg (GnuPG) 2.0."*) echo "Please upgrade to at least gpg 2.1.10 to check for weak signatures" > /dev/stderr - GPG_RES="$(echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)" + GPG_RES="$(printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)" ;; # We assume if you're running 2.1+, you're probably running 2.1.10+ # gpg will fail otherwise @@ -32,7 +32,7 @@ else # gpg will fail otherwise esac done - [ "$GPG_RES" = "" ] && GPG_RES="$(echo "$INPUT" | gpg --trust-model always --weak-digest sha1 "$@" 2>/dev/null)" + [ "$GPG_RES" = "" ] && GPG_RES="$(printf '%s\n' "$INPUT" | gpg --trust-model always --weak-digest sha1 "$@" 2>/dev/null)" fi for LINE in $(echo "$GPG_RES"); do case "$LINE" in @@ -57,8 +57,8 @@ if ! $VALID; then exit 1 fi if $VALID && $REVSIG; then - echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null | grep "\[GNUPG:\] \(NEWSIG\|SIG_ID\|VALIDSIG\)" + printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null | grep "\[GNUPG:\] \(NEWSIG\|SIG_ID\|VALIDSIG\)" echo "$GOODREVSIG" else - echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null + printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null fi |