Commit 054b170
committed
tests(tar) add and update symlink test files
tests/integration/archive/tar/__input__/symlinks.tar:
test/
|-- bin
| `-- busybox
`-- sbin
|-- cp -> /test/bin/busybox
|-- find -> ../bin/../bin/busybox
|-- ln -> /test/bin/../bin/busybox
|-- ls -> ../bin/busybox
|-- mv -> ../../bin/busybox
`-- rm -> ../../../bin/busybox
is extracted as
tests/integration/archive/tar/__output__/symlinks.tar_extract/
└── test
├── bin
│ └── busybox
└── sbin
├── cp -> ../bin/busybox
├── find -> ../bin/busybox
├── ln -> ../bin/busybox
├── ls -> ../bin/busybox
└── mv -> ../../bin/busybox
Please note, that `rm` is missing, as that is a path traversal attempt.
----
The symlinks.tar test file is created with this script in a docker container:
rm -rf /test symlinks.tar
mkdir -p /test/bin
echo binary > /test/bin/busybox
mkdir -p /test/sbin
ln -s ../bin/busybox /test/sbin/ls
ln -s ../bin/../bin/busybox /test/sbin/find
ln -s ../../bin/busybox /test/sbin/mv
ln -s ../../../bin/busybox /test/sbin/rm
ln -s /test/bin/busybox /test/sbin/cp
ln -s /test/bin/../bin/busybox /test/sbin/ln
tar cPf /symlinks.tar /test/
tar tvPf /symlinks.tar1 parent bbd75bb commit 054b170
7 files changed
+11
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments