Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reference/** linguist-vendored
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,5 @@ used by the pub client.

Big thanks to [Garett Tok Ern Liang](https://github.com/walnutdust) for writing the initial
Dart tar reader that this library is based on.

This project uses the [Tar file extraction test suite](https://doi.org/10.5281/zenodo.23617964) by Harmen Taeke Stoppels and William Woodruff.
4 changes: 4 additions & 0 deletions dart_test.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
platforms:
- "vm"
- "node"

tags:
known_minefield_failure:
skip: "TODO: Investigate potential bug in pkg:tar"
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ dev_dependencies:
file: ^7.0.0
path: ^1.8.0
test: ^1.20.0
crypto: ^3.0.8
18 changes: 18 additions & 0 deletions reference/minefield/F01-number-leading-space.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"id": "F01",
"verdict": "tolerate",
"description": "Numeric fields padded with spaces rather than zeros, as old tars wrote them.",
"features": [
"number.mode.leading-space",
"number.size.leading-space"
],
"tree": [
{
"path": "a",
"kind": "file",
"executable": false,
"size": 7,
"sha256": "e47fbedb2823cf1ae4d4cdb8273635be2024cb870588e259c9b23d76ae49d484"
}
]
}
Binary file not shown.
17 changes: 17 additions & 0 deletions reference/minefield/F02-end-data-after.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"id": "F02",
"verdict": "tolerate",
"description": "Data after the end-of-archive marker that is not a header, which is ignored.",
"features": [
"end.data-after"
],
"tree": [
{
"path": "a",
"kind": "file",
"executable": false,
"size": 2,
"sha256": "87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7"
}
]
}
Binary file added reference/minefield/F02-end-data-after.tar
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F03-end-lone-zero-block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F03",
"verdict": "reject",
"description": "An end-of-archive marker of one zero block, not two.",
"features": [
"end.lone-zero-block"
]
}
Binary file added reference/minefield/F03-end-lone-zero-block.tar
Binary file not shown.
17 changes: 17 additions & 0 deletions reference/minefield/F04-end-missing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"id": "F04",
"verdict": "tolerate",
"description": "No end-of-archive marker: the archive ends after a complete member.",
"features": [
"end.missing"
],
"tree": [
{
"path": "a",
"kind": "file",
"executable": false,
"size": 2,
"sha256": "87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7"
}
]
}
Binary file added reference/minefield/F04-end-missing.tar
Binary file not shown.
17 changes: 17 additions & 0 deletions reference/minefield/F05-magic-version-nuls.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"id": "F05",
"verdict": "tolerate",
"description": "The POSIX magic with NULs for its version, `\"ustar\\0\\0\\0\"`, as some Java archivers write.",
"features": [
"magic.posix-version-nuls"
],
"tree": [
{
"path": "a",
"kind": "file",
"executable": false,
"size": 2,
"sha256": "87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7"
}
]
}
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F06-checksum-signed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F06",
"verdict": "reject",
"description": "A checksum that only matches as the signed sum of the header.",
"features": [
"checksum.signed"
]
}
Binary file added reference/minefield/F06-checksum-signed.tar
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F07-end-archive-after.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F07",
"verdict": "reject",
"description": "Another archive after the end-of-archive marker.",
"features": [
"end.archive-after"
]
}
Binary file added reference/minefield/F07-end-archive-after.tar
Binary file not shown.
6 changes: 6 additions & 0 deletions reference/minefield/F08-end-truncated-in-member.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "F08",
"verdict": "reject",
"description": "An archive that ends inside the data of a member.",
"features": []
}
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F09-end-zero-block-then-member.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F09",
"verdict": "reject",
"description": "A zero block, then another member: the end of the archive, or not?",
"features": [
"end.zero-block-before-member"
]
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F10",
"verdict": "reject",
"description": "A pax `size` followed by a GNU long name: which of them does the size apply to?",
"features": [
"extended.pax-size-before-gnu-long"
]
}
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F11-magic-odd-version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F11",
"verdict": "reject",
"description": "The POSIX magic with a version that is neither `\"00\"` nor NULs.",
"features": [
"magic.posix-with-odd-version"
]
}
Binary file added reference/minefield/F11-magic-odd-version.tar
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F12-number-size-gap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F12",
"verdict": "reject",
"description": "A size with a space among its digits, which reads as two sizes.",
"features": [
"number.size.gap-in-digits"
]
}
Binary file added reference/minefield/F12-number-size-gap.tar
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F13-pax-newline-in-path.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F13",
"verdict": "reject",
"description": "A newline in a pax `path`, which split on lines is another record.",
"features": [
"pax.newline-in-value.path"
]
}
Binary file not shown.
24 changes: 24 additions & 0 deletions reference/minefield/F14-pax-size-disagrees.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"id": "F14",
"verdict": "tolerate",
"description": "A pax `size` that disagrees with the header's, so that a reader of the header's misses a member.",
"features": [
"pax.size-disagrees"
],
"tree": [
{
"path": "a",
"kind": "file",
"executable": false,
"size": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
{
"path": "smuggled",
"kind": "file",
"executable": false,
"size": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
}
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F15-pax-size-on-dir.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F15",
"verdict": "reject",
"description": "A pax `size` on a directory, which takes the next header for its data.",
"features": [
"pax.size-on-dir"
]
}
Binary file added reference/minefield/F15-pax-size-on-dir.tar
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F16-type-unknown.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F16",
"verdict": "reject",
"description": "An unknown typeflag with a size: data, or no data?",
"features": [
"type.unknown-Z"
]
}
Binary file added reference/minefield/F16-type-unknown.tar
Binary file not shown.
19 changes: 19 additions & 0 deletions reference/minefield/F17-pax-global-comment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"id": "F17",
"verdict": "accept",
"description": "The global pax header with only a `comment`, as `git archive` writes it.",
"features": [],
"tree": [
{
"path": "project",
"kind": "directory"
},
{
"path": "project/README",
"kind": "file",
"executable": false,
"size": 6,
"sha256": "5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03"
}
]
}
Binary file added reference/minefield/F17-pax-global-comment.tar
Binary file not shown.
24 changes: 24 additions & 0 deletions reference/minefield/F18-pax-global-comment-after-members.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"id": "F18",
"verdict": "tolerate",
"description": "A global pax header with only a `comment`, after the first member.",
"features": [
"pax-global.after-members"
],
"tree": [
{
"path": "a",
"kind": "file",
"executable": false,
"size": 2,
"sha256": "87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7"
},
{
"path": "b",
"kind": "file",
"executable": false,
"size": 2,
"sha256": "0263829989b6fd954f72baaf2fc64bc2e2f01d692d4de72986ea808f6e99813f"
}
]
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F19",
"verdict": "reject",
"description": "A global pax header between an extended header and its member.",
"features": [
"pax-global.between-extended-and-member"
]
}
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F20-pax-global-size.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F20",
"verdict": "reject",
"description": "A global pax header with a `size`, which frames every member after it, or none.",
"features": [
"pax-global.size"
]
}
Binary file added reference/minefield/F20-pax-global-size.tar
Binary file not shown.
9 changes: 9 additions & 0 deletions reference/minefield/F21-pax-size-empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"id": "F21",
"verdict": "reject",
"description": "An empty pax `size`, which in POSIX removes the size rather than giving one.",
"features": [
"pax.empty-value.size",
"pax.invalid-size"
]
}
Binary file added reference/minefield/F21-pax-size-empty.tar
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F22-pax-size-negative.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F22",
"verdict": "reject",
"description": "A negative pax `size`, which a member cannot have.",
"features": [
"pax.invalid-size"
]
}
Binary file added reference/minefield/F22-pax-size-negative.tar
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F23-pax-size-plus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F23",
"verdict": "reject",
"description": "A pax `size` with a plus sign, `+512`, which conversions of strings to numbers accept.",
"features": [
"pax.invalid-size"
]
}
Binary file added reference/minefield/F23-pax-size-plus.tar
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F24-pax-size-leading-space.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F24",
"verdict": "reject",
"description": "A pax `size` with a leading space, ` 512`, which conversions of strings to numbers skip.",
"features": [
"pax.invalid-size"
]
}
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F25-pax-size-not-ascii-digits.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F25",
"verdict": "reject",
"description": "A pax `size` in Arabic-Indic digits, `\u0665\u0661\u0662`, which some conversions of strings read as 512.",
"features": [
"pax.invalid-size"
]
}
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F26-pax-size-leading-zero.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F26",
"verdict": "reject",
"description": "A pax `size` with a leading zero, `0777`: 777 in decimal, as POSIX says, or 511 in octal.",
"features": [
"pax.size-leading-zero"
]
}
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F27-pax-size-too-large.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F27",
"verdict": "reject",
"description": "A pax `size` of 2^64 + 512, which wraps around to 512 in 64 bits.",
"features": [
"pax.size-too-large"
]
}
Binary file not shown.
22 changes: 22 additions & 0 deletions reference/minefield/F28-pax-newline-in-comment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"id": "F28",
"verdict": "accept",
"description": "A newline in a pax `comment`, which split on lines leaves a `size` record.",
"features": [],
"tree": [
{
"path": "a",
"kind": "file",
"executable": false,
"size": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
{
"path": "smuggled",
"kind": "file",
"executable": false,
"size": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
}
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F29-number-size-base256-negative.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F29",
"verdict": "reject",
"description": "A negative base-256 size in the header, -512, which a member cannot have.",
"features": [
"number.size.base256-negative"
]
}
Binary file not shown.
8 changes: 8 additions & 0 deletions reference/minefield/F30-number-size-base256-too-large.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "F30",
"verdict": "reject",
"description": "A base-256 size of 2^64 + 512 in the header, which wraps around to 512 in 64 bits.",
"features": [
"number.size.base256-too-large"
]
}
Binary file not shown.
15 changes: 15 additions & 0 deletions reference/minefield/F31-pax-xattr-not-utf8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"id": "F31",
"verdict": "accept",
"description": "An xattr in a pax header whose value is not UTF-8, as libarchive and star write them.",
"features": [],
"tree": [
{
"path": "a",
"kind": "file",
"executable": false,
"size": 2,
"sha256": "87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7"
}
]
}
Binary file not shown.
Loading
Loading