Skip to content

Commit beeaea4

Browse files
committed
refactor(assail): move atomic writes out to the generation-directory follow-up
The owner chose to keep this PR to the KYAML copy and its preflight alias checks. Race-resistant and crash-safe publishing moves to a stacked follow-up that publishes a generation directory for every output mode, so it covers the plain JSON path too. - Remove src/atomic_write.rs; outputs are written with fs::write as on main. - Keep every preflight check: .json name, symlink refusal, non-regular refusal, unknown-is-not-absent, hard-link detection. - Drop the companion-permissions test, which tested atomic_write's mode carrying; it moves with that code. - Document the remaining time-of-check/time-of-use and partial-write limits in the doc comment and CHANGELOG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PFaqv6iBXrt3W5Akd1Fq5k
1 parent e895f6a commit beeaea4

5 files changed

Lines changed: 12 additions & 431 deletions

File tree

‎CHANGELOG.adoc‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@ may be the same file: a symbolic link at any of their paths, or two existing
1212
paths that are hard links to one file, is refused before anything is written.
1313
So is a path that exists but is not a regular file (a directory, say) or that
1414
cannot be looked up, such as a derived name over the filesystem's length limit.
15-
In this mode each file is written by renaming a finished temporary file into
16-
place (`+atomic_write::write_replacing+`, which also flushes the directory so
17-
the rename survives a crash), so a link swapped in after those
18-
checks is replaced rather than written through, and no reader sees a partial
19-
report. On Unix a replaced file keeps the old file's permission bits, and the
20-
temporary file is never more readable than the file it replaces; a new copy or
21-
sidecar takes the report's permission bits, so a private report's companions
22-
are private too.
15+
These checks run before the writes, so a link swapped in between a check and
16+
its write is not caught, and a crash can leave a partial file: the planned
17+
generation-directory publish is meant to close both.
2318
Other formats are unchanged for `+assail+`.
2419

2520
==== Fixed — KYAML keys holding a line separator

‎src/atomic_write.rs‎

Lines changed: 0 additions & 368 deletions
This file was deleted.

‎src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pub mod amuck;
2424
pub mod assail;
2525
pub mod assay;
2626
pub mod assemblyline;
27-
pub mod atomic_write;
2827
pub mod attack;
2928
pub mod attestation;
3029
pub mod axial;

0 commit comments

Comments
 (0)