You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by as...@apache.org on 2017/02/26 20:59:45 UTC

svn commit: r1784484 - /subversion/trunk/tools/hook-scripts/reject-known-sha1-collisions.sh

Author: astieger
Date: Sun Feb 26 20:59:45 2017
New Revision: 1784484

URL: http://svn.apache.org/viewvc?rev=1784484&view=rev
Log:
* tools/hook-scripts/reject-known-sha1-collisions.sh
Use a more portable syntax for the [(1) (test(1)) tool.
Handle filenames with literal backslashes.

Patch by: danielsh

Modified:
    subversion/trunk/tools/hook-scripts/reject-known-sha1-collisions.sh

Modified: subversion/trunk/tools/hook-scripts/reject-known-sha1-collisions.sh
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/hook-scripts/reject-known-sha1-collisions.sh?rev=1784484&r1=1784483&r2=1784484&view=diff
==============================================================================
--- subversion/trunk/tools/hook-scripts/reject-known-sha1-collisions.sh (original)
+++ subversion/trunk/tools/hook-scripts/reject-known-sha1-collisions.sh Sun Feb 26 20:59:45 2017
@@ -39,9 +39,9 @@ if [ $? -ne 0 ]; then
   exit 2
 fi
 
-$SVNLOOK changed -t "$TXN" "$REPOS" | /usr/bin/grep -Ev '^D ' | /usr/bin/sed -e 's/^.   //' | /usr/bin/grep -v '/$' | while read FILE; do
+$SVNLOOK changed -t "$TXN" "$REPOS" | /usr/bin/grep -Ev '^D ' | /usr/bin/sed -e 's/^.   //' | /usr/bin/grep -v '/$' | while IFS= read -r FILE; do
   PREFIX=`$SVNLOOK cat -t "$TXN" "$REPOS" "$FILE" | $HEAD -c320 | $SHA1SUM | cut -c-40`
-  if [ "$PREFIX" == 'f92d74e3874587aaf443d1db961d4e26dde13e9c' ]; then
+  if [ x"$PREFIX" = x'f92d74e3874587aaf443d1db961d4e26dde13e9c' ]; then
         echo "known SHA-1 collision rejected" >&2
         exit 3
   fi