[flashrom] [commit] r1221 - trunk/util

repository service svn at flashrom.org
Tue Nov 2 01:16:27 CET 2010


Author: hailfinger
Date: Tue Nov  2 01:16:27 2010
New Revision: 1221
URL: http://flashrom.org/trac/flashrom/changeset/1221

Log:
Use mktemp unconditionally for security reasons.
Avoid non-portable seq.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
Acked-by: Idwer Vollering <vidwer at gmail.com>

Modified:
   trunk/util/flashrom_partial_write_test.sh

Modified: trunk/util/flashrom_partial_write_test.sh
==============================================================================
--- trunk/util/flashrom_partial_write_test.sh	Mon Nov  1 23:07:04 2010	(r1220)
+++ trunk/util/flashrom_partial_write_test.sh	Tue Nov  2 01:16:27 2010	(r1221)
@@ -34,8 +34,12 @@
 echo "testing flashrom binary: ${FLASHROM}"
 
 OLDDIR=$(pwd)
-if [ -z "$TMPDIR" ]; then
-	TMPDIR=$(mktemp -d)	# test data location
+
+# test data location
+TMPDIR=$(mktemp -d -t flashrom_test.XXXXXXXXXX)
+if [ "$?" != "0" ] ; then
+	echo "Could not create temporary directory"
+	exit $EXIT_FAILURE
 fi
 
 ZERO_4K="00_4k.bin"
@@ -65,8 +69,10 @@
 
 # Make 4k worth of 0xff bytes
 echo "begin 640 $FF_4K" > "$FF_4K_TEXT"
-for i in `seq 0 90` ; do
+i=0
+while [ $i -le 90 ] ; do
 	echo "M____________________________________________________________" >> "$FF_4K_TEXT"
+	i=$((${i} + 1))
 done
 echo "!_P``" >> "$FF_4K_TEXT"
 echo "\`" >> "$FF_4K_TEXT"




More information about the flashrom mailing list