craft-testkit's hostile hammer reads CRAFT_HOSTILE_DIVISOR=N: the unmodified
seed, every N-th truncation and 1/N of the rounds. hostile::divisor() gives the
same value to sweeps written without the hammer; craft-image-codecs' TIFF zoo
and malformed-header sweeps use it, with a different offset per input so the
inputs together still reach every position. Proptests without their own case
count read proptest's PROPTEST_CASES.
The Workspace gate and the media, audio, video and PDF workflows set
CRAFT_HOSTILE_DIVISOR=8 and PROPTEST_CASES=64. The longest of these tests
(craft-media's MXF hostile input, 1,310 s on Windows; craft-pdf's crypt
proptests, up to 257 s; the image-codecs sweeps, 140-162 s) drop to about an
eighth or a quarter. nightly.yml runs the whole workspace on Linux without
either variable, so every case still runs once a day.
The gate's test-input setup moves to scripts/ci-test-inputs.sh, shared by both
workflows; it uses a corpus that is already present.
* har: preserve source reader history
Port Craft Anything crates/formats/src/har.rs from f64ae3bf3c8863a982af1304e06de20653803968.
* har: preserve source reader history
Port Craft Anything crates/formats/src/har.rs from cb0bb9d8fa4536ba44ef2c86f5ed759b879cc2d3.
* Expose shared HAR reader with explicit input admission
---------
Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: BFlat <bombayapirat@gmail.com>
* tar: port old GNU sparse extension traversal from Craft Anything
Source: storytold/craft-anything#1973, 8ea2ec66a1bc80f0420f3695baac877a0cb9b9a5. Retains non-extractable sparse member kind and regression tests.
* tar: preserve GNU CRC symlink checksum compatibility
Source: storytold/craft-anything#1984, b226a475f7dce9710e3af7a069386fe7a9720df7; preserves nonzero checks and regular-file checksum validation.
* tar: apply valid PAX sizes before legacy member size fields
Source: storytold/craft-anything#2007, d29465c20b0d570ea4973be512a0cb4e212bb60f; metadata records still retain their own framing.
* Record provenance of current TAR and CPIO compatibility fixes
---------
Co-authored-by: RRFZ <247457381+Plastic-time@users.noreply.github.com>
craft-audio names its VMD decoder feature `vmd-decode`, and craft-video
names a codec's decoder `<codec>-decode` wherever the codec may also have
an encoder (mpeg2, mpeg4, vp8…). The video decoder now follows that:
`vmd-decode` gates the module and its VideoFrame conversion, and `vmd`
turns it on, so `vmd` keeps working and an encoder can be added later
without renaming.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
benandez's re-review reproduced three escapes the first confinement fix still
left open. A dangling symlink: canonicalize reported it as missing, so the
old confine_to_root walked up to root and accepted it, and write created the
symlink's target for real, outside root. A check-then-use race: confine_to_root
checked one path string and a later fs::read or fs::write resolved that same
string again, a second lookup a concurrently swapped link could land in
between. A hard link: write truncated the shared inode in place, with nothing
in a canonicalized path to show that another name pointed at the same file
outside root.
list, read, write and create now resolve every already segment-checked
relative path through a cap_std::fs::Dir capability opened on root, instead
of joining an absolute OS path and handing it to plain std::fs. cap_std
resolves one path component at a time against real, already-open directory
handles, so a symlink or a Windows junction cannot walk resolution above
root, dangling or not, and there is no separate check with a window for the
directory tree to change underneath it: the one resolution is the open. This
is the same family of guarantee craft-font-store already depends on through
cap-primitives, which cap_std is built on.
write no longer truncates its target in place either way: it writes a new
sibling file and renames it over the target, so a hard link's directory
entry is replaced rather than its shared content being overwritten.
Per that review's non-blocking notes: a name that already exists on disk
with an ordinary ':' or '\' byte (macOS stores a typed '/' as ':') stays
reachable by list and read, since neither character is a path separator on
any platform's filesystem; the stricter refusal now applies only to a name
being chosen by Create. Create also goes back to bringing a fresh root into
existence, matching its behaviour before the first confinement fix. A
Windows reserved device name (CON, COM1, CONIN$, with or without an
extension) is refused in a chosen name on every platform.
Regression tests reproduce all three escapes (dangling symlink, swapped-link
race, hard link), plus the previously missing coverage: a link in the folder
a Create targets, and a write test that actually reaches disk instead of
being refused for an unrelated reason before confinement ever ran. Verified
by hand that each of the three new write-path tests fails against the
pre-fix pattern (an absolute OS path joined by string concatenation) before
trusting them.
real_files_match_ffmpeg waited for ffmpeg without looking at its exit
status, so pictures that matched before ffmpeg failed still passed. It now
asserts success, as the generated-file oracle does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FredApps' re-review found that resolve only split on slash and rejected a
segment equal to parent-dir, with no constraint on a Windows backslash, a
drive letter or UNC prefix, or a filesystem link, and that create joined
the Job::Create name onto the resolved folder with no validation of the
name at all.
Every path segment, and a Create name on its own, now goes through one
shared confine_segment check: accepted only when it parses as exactly one
Component::Normal equal to the original text, with a backslash or colon
refused outright first so a Windows-shaped escape cannot slip past a
Linux build's narrower native parser. A second shared check, confine_to_root,
canonicalises the nearest existing ancestor of a resolved path and
confirms it still sits under the canonicalised root, refusing a symlink or
a Windows junction that would otherwise redirect outside it. List, read,
write and create all run both checks before touching disk.
Regression tests cover the review's own examples (a parent segment, an
absolute path, the three Windows-shaped forms) for Create, the same
Windows-shaped escape for a List folder path, and a symlink (Unix) or
junction (Windows) placed inside the root for list, read and write, each
against a sibling sentinel file and directory that must stay untouched.