diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-03-01 17:21:07 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-03-01 17:21:07 +0100 |
commit | 5e29e263888284b2451debd9e5cb138b48fd293a (patch) | |
tree | 9971260e354b6385f53bfe57408bf4bff184a78f /testsuite | |
parent | 7d65abea092e917bc2320cbf1d5a2dccb2a8288f (diff) | |
download | busybox-w32-5e29e263888284b2451debd9e5cb138b48fd293a.tar.gz busybox-w32-5e29e263888284b2451debd9e5cb138b48fd293a.tar.bz2 busybox-w32-5e29e263888284b2451debd9e5cb138b48fd293a.zip |
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 <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/tar.tests | 17 |
1 files changed, 17 insertions, 0 deletions
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 | |||
168 | " \ | 168 | " \ |
169 | "" "" | 169 | "" "" |
170 | 170 | ||
171 | # On extract, everything up to and including last ".." component is stripped | ||
172 | testing "tar strips /../ on extract" "\ | ||
173 | rm -rf input_* test.tar 2>/dev/null | ||
174 | mkdir input_dir | ||
175 | echo Ok >input_dir/file | ||
176 | tar cf test.tar ./../tar.tempdir/input_dir/../input_dir 2>&1 | ||
177 | rm -rf input_* 2>/dev/null | ||
178 | tar -vxf test.tar 2>&1 | ||
179 | cat input_dir/file 2>&1 | ||
180 | " "\ | ||
181 | tar: removing leading './../tar.tempdir/input_dir/../' | ||
182 | input_dir/ | ||
183 | input_dir/file | ||
184 | Ok | ||
185 | " \ | ||
186 | "" "" | ||
187 | |||
171 | 188 | ||
172 | cd .. && rm -rf tar.tempdir || exit 1 | 189 | cd .. && rm -rf tar.tempdir || exit 1 |
173 | 190 | ||