Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Oct 2011 21:41:54 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r226352 - stable/8/usr.sbin/portsnap/portsnap
Message-ID:  <201110132141.p9DLfsDp033473@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Thu Oct 13 21:41:54 2011
New Revision: 226352
URL: http://svn.freebsd.org/changeset/base/226352

Log:
  MFC r226028: portsnap: Detect error immediately if we can't fetch the
  snapshot metadata.
  
  Also add some quotes around command substitution where useful and possible.

Modified:
  stable/8/usr.sbin/portsnap/portsnap/portsnap.sh
Directory Properties:
  stable/8/usr.sbin/portsnap/   (props changed)

Modified: stable/8/usr.sbin/portsnap/portsnap/portsnap.sh
==============================================================================
--- stable/8/usr.sbin/portsnap/portsnap/portsnap.sh	Thu Oct 13 20:36:43 2011	(r226351)
+++ stable/8/usr.sbin/portsnap/portsnap/portsnap.sh	Thu Oct 13 21:41:54 2011	(r226352)
@@ -536,9 +536,9 @@ fetch_metadata() {
 	rm -f ${SNAPSHOTHASH} tINDEX.new
 
 	echo ${NDEBUG} "Fetching snapshot metadata... "
-	fetch ${QUIETFLAG} http://${SERVERNAME}/t/${SNAPSHOTHASH}
+	fetch ${QUIETFLAG} http://${SERVERNAME}/t/${SNAPSHOTHASH} \
 	    2>${QUIETREDIR} || return
-	if [ `${SHA256} -q ${SNAPSHOTHASH}` != ${SNAPSHOTHASH} ]; then
+	if [ "`${SHA256} -q ${SNAPSHOTHASH}`" != ${SNAPSHOTHASH} ]; then
 		echo "snapshot metadata corrupt."
 		return 1
 	fi
@@ -606,7 +606,7 @@ fetch_index_sanity() {
 # Verify a list of files
 fetch_snapshot_verify() {
 	while read F; do
-		if [ `gunzip -c snap/${F} | ${SHA256} -q` != ${F} ]; then
+		if [ "`gunzip -c snap/${F} | ${SHA256} -q`" != ${F} ]; then
 			echo "snapshot corrupt."
 			return 1
 		fi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110132141.p9DLfsDp033473>