From 72c8155d9fc0eaeac72c053f46ebb7b231d4596a Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 31 Jan 2023 11:30:46 +0100 Subject: Reintegrate test code with library code Signed-off-by: David Oberhollenzer --- bin/rdsquashfs/test/pathtraversal.sh.in | 12 ++++++++++++ bin/rdsquashfs/test/pathtraversal.sqfs | Bin 0 -> 4096 bytes 2 files changed, 12 insertions(+) create mode 100644 bin/rdsquashfs/test/pathtraversal.sh.in create mode 100644 bin/rdsquashfs/test/pathtraversal.sqfs (limited to 'bin/rdsquashfs/test') diff --git a/bin/rdsquashfs/test/pathtraversal.sh.in b/bin/rdsquashfs/test/pathtraversal.sh.in new file mode 100644 index 0000000..5b19c4d --- /dev/null +++ b/bin/rdsquashfs/test/pathtraversal.sh.in @@ -0,0 +1,12 @@ +#!/bin/sh + +RDSQFS="@abs_top_builddir@/rdsquashfs" +REFFILE="@abs_top_srcdir@/bin/rdsquashfs/test/pathtraversal.sqfs" +GOTCHA="/tmp/gotcha.txt" + +if "$RDSQFS" -u / -p . "$REFFILE"; then + if [ -e "$GOTCHA" ]; then + echo "Found $GOTCHA which should not be there" + exit 1 + fi +fi diff --git a/bin/rdsquashfs/test/pathtraversal.sqfs b/bin/rdsquashfs/test/pathtraversal.sqfs new file mode 100644 index 0000000..0c33bb3 Binary files /dev/null and b/bin/rdsquashfs/test/pathtraversal.sqfs differ -- cgit v1.2.3