[flashrom] [PATCH] Torture script fixes
Paul Menzel
paulepanter at users.sourceforge.net
Sat Oct 30 09:43:08 CEST 2010
Am Samstag, den 30.10.2010, 02:16 +0200 schrieb Carl-Daniel Hailfinger:
> Use mktemp unconditionally for security reasons.
> Avoid non-portable seq.
>
> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
>
> Index: flashrom-torturescript_portability/util/flashrom_partial_write_test.sh
> ===================================================================
> --- flashrom-torturescript_portability/util/flashrom_partial_write_test.sh (Revision 1219)
> +++ flashrom-torturescript_portability/util/flashrom_partial_write_test.sh (Arbeitskopie)
> @@ -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"
Full stop at the end.
Is `mktemp` always installed? If not will there be an error message –
passed down from Bash – indicating that it needs to be installed?
> + 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"
Thanks,
Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20101030/1bbb3688/attachment.asc>
More information about the flashrom
mailing list