summaryrefslogtreecommitdiffstats
path: root/util/flashrom_partial_write_test.sh
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-11-02 00:16:27 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-11-02 00:16:27 +0000
commiteb6337f7527450b58658d271a077cd7fc02c1d5b (patch)
treed62d5e6c0b976c027e758024e8df88adca7d6def /util/flashrom_partial_write_test.sh
parentf68aa8aca0a7e2852269f1b85b16535a3fb7cd14 (diff)
downloadast2050-flashrom-eb6337f7527450b58658d271a077cd7fc02c1d5b.zip
ast2050-flashrom-eb6337f7527450b58658d271a077cd7fc02c1d5b.tar.gz
Use mktemp unconditionally for security reasons
Avoid non-portable seq. Corresponding to flashrom svn r1221. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Idwer Vollering <vidwer@gmail.com>
Diffstat (limited to 'util/flashrom_partial_write_test.sh')
-rwxr-xr-xutil/flashrom_partial_write_test.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/util/flashrom_partial_write_test.sh b/util/flashrom_partial_write_test.sh
index 7cf37c9..d5413b8 100755
--- a/util/flashrom_partial_write_test.sh
+++ b/util/flashrom_partial_write_test.sh
@@ -34,8 +34,12 @@ fi
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 @@ echo "Running test in ${TMPDIR}"
# 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"
OpenPOWER on IntegriCloud