From 5e29e263888284b2451debd9e5cb138b48fd293a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 1 Mar 2011 17:21:07 +0100 Subject: tar: on extract, everything up to and including last ".." is stripped function old new delta get_header_tar 1493 1545 +52 Signed-off-by: Denys Vlasenko --- testsuite/tar.tests | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'testsuite/tar.tests') diff --git a/testsuite/tar.tests b/testsuite/tar.tests index 472064f7f..d41d10d57 100755 --- a/testsuite/tar.tests +++ b/testsuite/tar.tests @@ -168,6 +168,23 @@ Ok " \ "" "" +# On extract, everything up to and including last ".." component is stripped +testing "tar strips /../ on extract" "\ +rm -rf input_* test.tar 2>/dev/null +mkdir input_dir +echo Ok >input_dir/file +tar cf test.tar ./../tar.tempdir/input_dir/../input_dir 2>&1 +rm -rf input_* 2>/dev/null +tar -vxf test.tar 2>&1 +cat input_dir/file 2>&1 +" "\ +tar: removing leading './../tar.tempdir/input_dir/../' +input_dir/ +input_dir/file +Ok +" \ +"" "" + cd .. && rm -rf tar.tempdir || exit 1 -- cgit v1.2.3