Commit 0dec6be
committed
fix(handlers): fix edge cases in tar handler (empty name, too long name).
tarfile python library does not perform any kind of defensive
programming and will trigger OS level errors like ENAMETOOLONG trying to
write files that have long names.
This commit adds two checks to our safe implementation of tarfile so
that we log the issue with a warning and skip the file.
Note: tar files with such entries (long name, empty name) do not happen
naturally and must be synthesized. That's why decided to skip them, in a
similar fashion than GNU tar and 7zip.1 parent 5c886cc commit 0dec6be
File tree
5 files changed
+21
-0
lines changed- tests/integration/archive/tar
- __input__
- __output__
- emptyname.tar_extract
- longname.tar_extract
- unblob/handlers/archive
5 files changed
+21
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 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: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
21 | 30 | | |
22 | 31 | | |
23 | 32 | | |
| |||
0 commit comments