mirror of
https://github.com/openSUSE/osc.git
synced 2025-09-08 14:08:42 +02:00
Forbid extracting files with absolute path from 'cpio' archives (boo#1122683)
Also fix and modernize the code, add tests.
This commit is contained in:
7
tests/fixtures/README
vendored
7
tests/fixtures/README
vendored
@@ -26,3 +26,10 @@ Create archive.ar
|
||||
ar qP archive.ar /tmp/foo /123 very-long-long-long-long-name very-long-long-long-long-name2 'very-long-name
|
||||
-with-newline' 'a
|
||||
b' dir/file
|
||||
|
||||
|
||||
Create archive.cpio
|
||||
-------------------
|
||||
|
||||
printf "/tmp/foo\0/123\0very-long-long-long-long-name\0very-long-long-long-long-name2\0very-long-name
|
||||
-with-newline\0a\nb\0dir/file\0" | cpio -ocv0 --owner=root:root > archive.cpio
|
||||
|
BIN
tests/fixtures/archive.cpio
vendored
Normal file
BIN
tests/fixtures/archive.cpio
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user