aboutsummaryrefslogtreecommitdiff
path: root/tests/rdsquashfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-08-14 12:37:02 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-08-14 15:12:24 +0200
commit1deb54c95d508f9adce1dddb073f0b0e4f8e7ba1 (patch)
tree5f257a566f89701641a030d7b2eb3604c3d7cfc9 /tests/rdsquashfs
parentad109e2b119cb3ed27c7d964be9625d415447eb1 (diff)
Add a test case for the path traversal bug
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests/rdsquashfs')
-rw-r--r--tests/rdsquashfs/pathtraversal.sh.in12
-rw-r--r--tests/rdsquashfs/pathtraversal.sqfsbin0 -> 4096 bytes
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/rdsquashfs/pathtraversal.sh.in b/tests/rdsquashfs/pathtraversal.sh.in
new file mode 100644
index 0000000..6dd9fab
--- /dev/null
+++ b/tests/rdsquashfs/pathtraversal.sh.in
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+RDSQFS="@abs_top_builddir@/rdsquashfs"
+REFFILE="@abs_top_srcdir@/tests/rdsquashfs/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/tests/rdsquashfs/pathtraversal.sqfs b/tests/rdsquashfs/pathtraversal.sqfs
new file mode 100644
index 0000000..0c33bb3
--- /dev/null
+++ b/tests/rdsquashfs/pathtraversal.sqfs
Binary files differ