From 1e52dff3276810c633a2ad5dd3b010ee97a6331a Mon Sep 17 00:00:00 2001 From: David Phillips Date: Mon, 5 Sep 2016 21:28:07 +1200 Subject: Remove free filename format due to vulnerability --- test/001-basic.test/stderr.expected | 2 +- test/002-no-timestamp.test/run.sh | 2 +- test/003-run-to-eof.test/run.sh | 4 ++-- test/003-run-to-eof.test/stdout.expected | 2 +- test/004-multi-tracks.test/001-track.raw.expected | 1 + test/004-multi-tracks.test/002-track.raw.expected | 1 + test/004-multi-tracks.test/003-track.raw.expected | 1 + test/004-multi-tracks.test/004-track.raw.expected | 1 + test/004-multi-tracks.test/run.sh | 4 ++-- test/004-multi-tracks.test/stdout.expected | 8 ++++---- test/004-multi-tracks.test/track_1.raw.expected | 1 - test/004-multi-tracks.test/track_2.raw.expected | 1 - test/004-multi-tracks.test/track_3.raw.expected | 1 - test/004-multi-tracks.test/track_4.raw.expected | 1 - test/007-unreadable-infile.test/run.sh | 2 +- test/008-unwritable-outfile.test/run.sh | 8 ++++---- test/008-unwritable-outfile.test/stderr.expected | 1 - test/009-finish-before-start.test/run.sh | 4 ++-- test/009-finish-before-start.test/stderr.expected | 2 +- test/010-malformed-timestamp.test/run.sh | 2 +- test/011-filename-too-large.test/run.sh | 2 +- 21 files changed, 25 insertions(+), 26 deletions(-) create mode 100644 test/004-multi-tracks.test/001-track.raw.expected create mode 100644 test/004-multi-tracks.test/002-track.raw.expected create mode 100644 test/004-multi-tracks.test/003-track.raw.expected create mode 100644 test/004-multi-tracks.test/004-track.raw.expected delete mode 100644 test/004-multi-tracks.test/track_1.raw.expected delete mode 100644 test/004-multi-tracks.test/track_2.raw.expected delete mode 100644 test/004-multi-tracks.test/track_3.raw.expected delete mode 100644 test/004-multi-tracks.test/track_4.raw.expected delete mode 100644 test/008-unwritable-outfile.test/stderr.expected (limited to 'test') diff --git a/test/001-basic.test/stderr.expected b/test/001-basic.test/stderr.expected index bdf19af..ca756eb 100644 --- a/test/001-basic.test/stderr.expected +++ b/test/001-basic.test/stderr.expected @@ -5,4 +5,4 @@ Options: -c channel_count -i input_file -s size of a single channel's sample (bytes) - -f name_format (%d and co are replaced with track number) + -n output file name (prepended with track number) diff --git a/test/002-no-timestamp.test/run.sh b/test/002-no-timestamp.test/run.sh index 37ac673..399eaee 100644 --- a/test/002-no-timestamp.test/run.sh +++ b/test/002-no-timestamp.test/run.sh @@ -1,6 +1,6 @@ #!/bin/sh -echo | ${EXECUTABLE} -r 44100 -c 1 -s 2 -i /dev/zero -f track_%d.raw +echo | ${EXECUTABLE} -r 44100 -c 1 -s 2 -i /dev/zero -n track.raw if [ $? -eq 0 ]; then exit 1 diff --git a/test/003-run-to-eof.test/run.sh b/test/003-run-to-eof.test/run.sh index 6fa2fd4..80cd3ab 100644 --- a/test/003-run-to-eof.test/run.sh +++ b/test/003-run-to-eof.test/run.sh @@ -3,6 +3,6 @@ # create large file dd if=/dev/urandom of=raw bs=1M count=1 -echo 0:0:0 | ${EXECUTABLE} -r 44100 -c 1 -s 2 -i raw -f track_%d.raw +echo 0:0:0 | ${EXECUTABLE} -r 44100 -c 1 -s 2 -i raw -n -track.raw -diff raw track_1.raw >/dev/null && rm raw track_1.raw +diff raw 001-track.raw >/dev/null && rm raw 001-track.raw diff --git a/test/003-run-to-eof.test/stdout.expected b/test/003-run-to-eof.test/stdout.expected index ae96076..612c42c 100644 --- a/test/003-run-to-eof.test/stdout.expected +++ b/test/003-run-to-eof.test/stdout.expected @@ -1 +1 @@ -track_1.raw starts 0.000000 s, finishes EOF +001-track.raw starts 0.000000 s, finishes EOF diff --git a/test/004-multi-tracks.test/001-track.raw.expected b/test/004-multi-tracks.test/001-track.raw.expected new file mode 100644 index 0000000..c227083 --- /dev/null +++ b/test/004-multi-tracks.test/001-track.raw.expected @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/test/004-multi-tracks.test/002-track.raw.expected b/test/004-multi-tracks.test/002-track.raw.expected new file mode 100644 index 0000000..d800886 --- /dev/null +++ b/test/004-multi-tracks.test/002-track.raw.expected @@ -0,0 +1 @@ +123 \ No newline at end of file diff --git a/test/004-multi-tracks.test/003-track.raw.expected b/test/004-multi-tracks.test/003-track.raw.expected new file mode 100644 index 0000000..be01025 --- /dev/null +++ b/test/004-multi-tracks.test/003-track.raw.expected @@ -0,0 +1 @@ +456789 \ No newline at end of file diff --git a/test/004-multi-tracks.test/004-track.raw.expected b/test/004-multi-tracks.test/004-track.raw.expected new file mode 100644 index 0000000..72d007b --- /dev/null +++ b/test/004-multi-tracks.test/004-track.raw.expected @@ -0,0 +1 @@ +ABCDEFGHIJKLMNOPQRSTUVWXYZ diff --git a/test/004-multi-tracks.test/run.sh b/test/004-multi-tracks.test/run.sh index 7bb987c..ada523a 100644 --- a/test/004-multi-tracks.test/run.sh +++ b/test/004-multi-tracks.test/run.sh @@ -3,10 +3,10 @@ # create large file echo 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ > raw -echo -e '0:0:0\n0:1:0\n0:4:0\n0:10:0' | ${EXECUTABLE} -r 1 -c 1 -s 1 -i raw -f track_%d.raw +echo -e '0:0:0\n0:1:0\n0:4:0\n0:10:0' | ${EXECUTABLE} -r 1 -c 1 -s 1 -i raw -n -track.raw -for track in track_{1..4}.raw ; do +for track in {001..004}-track.raw ; do diff $track $track.expected >/dev/null if [ $? -eq 0 ] ; then rm $track diff --git a/test/004-multi-tracks.test/stdout.expected b/test/004-multi-tracks.test/stdout.expected index fc02f0b..4d4dc27 100644 --- a/test/004-multi-tracks.test/stdout.expected +++ b/test/004-multi-tracks.test/stdout.expected @@ -1,4 +1,4 @@ -track_1.raw starts 0.000000 s, finishes 1.000000 s -track_2.raw starts 1.000000 s, finishes 4.000000 s -track_3.raw starts 4.000000 s, finishes 10.000000 s -track_4.raw starts 10.000000 s, finishes EOF +001-track.raw starts 0.000000 s, finishes 1.000000 s +002-track.raw starts 1.000000 s, finishes 4.000000 s +003-track.raw starts 4.000000 s, finishes 10.000000 s +004-track.raw starts 10.000000 s, finishes EOF diff --git a/test/004-multi-tracks.test/track_1.raw.expected b/test/004-multi-tracks.test/track_1.raw.expected deleted file mode 100644 index c227083..0000000 --- a/test/004-multi-tracks.test/track_1.raw.expected +++ /dev/null @@ -1 +0,0 @@ -0 \ No newline at end of file diff --git a/test/004-multi-tracks.test/track_2.raw.expected b/test/004-multi-tracks.test/track_2.raw.expected deleted file mode 100644 index d800886..0000000 --- a/test/004-multi-tracks.test/track_2.raw.expected +++ /dev/null @@ -1 +0,0 @@ -123 \ No newline at end of file diff --git a/test/004-multi-tracks.test/track_3.raw.expected b/test/004-multi-tracks.test/track_3.raw.expected deleted file mode 100644 index be01025..0000000 --- a/test/004-multi-tracks.test/track_3.raw.expected +++ /dev/null @@ -1 +0,0 @@ -456789 \ No newline at end of file diff --git a/test/004-multi-tracks.test/track_4.raw.expected b/test/004-multi-tracks.test/track_4.raw.expected deleted file mode 100644 index 72d007b..0000000 --- a/test/004-multi-tracks.test/track_4.raw.expected +++ /dev/null @@ -1 +0,0 @@ -ABCDEFGHIJKLMNOPQRSTUVWXYZ diff --git a/test/007-unreadable-infile.test/run.sh b/test/007-unreadable-infile.test/run.sh index 0d8262d..e260961 100755 --- a/test/007-unreadable-infile.test/run.sh +++ b/test/007-unreadable-infile.test/run.sh @@ -3,7 +3,7 @@ touch foo.in chmod -r foo.in -${EXECUTABLE} -r 1 -c 1 -i foo.in -s 1 -f track%2d.raw +${EXECUTABLE} -r 1 -c 1 -i foo.in -s 1 -n -track.raw if [ $? -eq 0 ]; then exit 1 diff --git a/test/008-unwritable-outfile.test/run.sh b/test/008-unwritable-outfile.test/run.sh index c8f1b4c..60336ae 100755 --- a/test/008-unwritable-outfile.test/run.sh +++ b/test/008-unwritable-outfile.test/run.sh @@ -1,13 +1,13 @@ #!/bin/sh -touch track.raw -chmod -w track.raw +touch 001-track.raw +chmod -w 001-track.raw -echo -e '0:0:0\n1:0:0' | ${EXECUTABLE} -r 1 -c 1 -i /dev/null -s 1 -f track.raw +echo -e '0:0:0\n1:0:0' | ${EXECUTABLE} -r 1 -c 1 -i /dev/null -s 1 -n -track.raw if [ $? -eq 0 ]; then exit 1 else - rm -f track.raw + rm -f 001-track.raw exit 0 fi diff --git a/test/008-unwritable-outfile.test/stderr.expected b/test/008-unwritable-outfile.test/stderr.expected deleted file mode 100644 index 37328e8..0000000 --- a/test/008-unwritable-outfile.test/stderr.expected +++ /dev/null @@ -1 +0,0 @@ -Failed to open 'track.raw': fopen: Permission denied diff --git a/test/009-finish-before-start.test/run.sh b/test/009-finish-before-start.test/run.sh index bc7422c..156f5bf 100755 --- a/test/009-finish-before-start.test/run.sh +++ b/test/009-finish-before-start.test/run.sh @@ -2,11 +2,11 @@ dd if=/dev/urandom of=input.raw bs=1M count=1 2>/dev/null -echo -e '0:1:0\n0:0:0\n' | ${EXECUTABLE} -r 1 -c 1 -i input.raw -s 1 -f track.raw +echo -e '0:1:0\n0:0:0\n' | ${EXECUTABLE} -r 1 -c 1 -i input.raw -s 1 -n -track.raw retval=$? if [ $retval -eq 0 ]; then - rm -f {track,input}.raw + rm -f {001-track,input}.raw fi exit $retval diff --git a/test/009-finish-before-start.test/stderr.expected b/test/009-finish-before-start.test/stderr.expected index 55896ae..2547f51 100644 --- a/test/009-finish-before-start.test/stderr.expected +++ b/test/009-finish-before-start.test/stderr.expected @@ -1 +1 @@ -ERROR: Finish time can't be before start time, skipping track.raw +ERROR: Finish time can't be before start time, skipping 001-track.raw diff --git a/test/010-malformed-timestamp.test/run.sh b/test/010-malformed-timestamp.test/run.sh index e33ff75..069e955 100755 --- a/test/010-malformed-timestamp.test/run.sh +++ b/test/010-malformed-timestamp.test/run.sh @@ -1,6 +1,6 @@ #!/bin/sh -echo -e '0:a' | ${EXECUTABLE} -r 1 -c 1 -i /dev/zero -s 1 -f track.raw +echo -e '0:a' | ${EXECUTABLE} -r 1 -c 1 -i /dev/zero -s 1 -n -track.raw if [ $? -eq 0 ]; then exit 1 diff --git a/test/011-filename-too-large.test/run.sh b/test/011-filename-too-large.test/run.sh index f09779e..69471c8 100644 --- a/test/011-filename-too-large.test/run.sh +++ b/test/011-filename-too-large.test/run.sh @@ -2,7 +2,7 @@ dd if=/dev/zero of=in.raw bs=1K count=1 2>/dev/null -${EXECUTABLE} -r 1 -c 1 -s 1 -i in.raw -f aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ +${EXECUTABLE} -r 1 -c 1 -s 1 -i in.raw -n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ -- cgit v1.1