Repository navigation
Commit 8fa7d85
committed
Stage the confined write's bytes after staging, and copy the target mode onto it
CI's ubuntu leg was red on three rows of safeWriteJson.test.ts that windows
skips, and all three were this merge's doing:
- "confines a write whose symlink referent stays inside the confined directory"
and "confines a scope path that itself runs through a symlink and does not exist
yet" both died with `ENOENT: no such file or directory, open '<dir>/.<name>
new_<ts>_<rand>.tmp'`. The escape-undo capture read the staged temp before
_streamDataToFile had written it, so every confined write that reached the publish
tried to read a file that did not exist yet. Windows never showed this because
those rows are test.skipIf(win32), and this box cannot make a file symlink at all
(measured on pinned node v22.23.4: fs.symlinkSync of a file -> EPERM).
- "preserves a restrictive 0o600 target mode through the atomic publish" failed with
`expected 420 to be 384`: the publish widened a 0o600 target to 0o644. The blob
main brought in stages with the umask default and never copies the target's mode;
the Zoo-Code-Org#1912 head 085fbf8 carries _copyTargetMode for this same function, and that
head is not an ancestor of 73931fe (git merge-base --is-ancestor, exit 1), so this
does not claim main accepted and dropped it - only that the two resolutions differ
on a permission property, which is the leftover recorded on the PR rather than a
thing to resolve silently inside one unit.
Both fixes hold the seam rule: staging, the mode copy, the flush, the commit rename
and the rollback rename all name the same resolved string. The helper is grafted
verbatim from 085fbf8 (stat the target, chmod the staged file, log and continue on
a stat or chmod failure, nothing to copy for a target that is not there yet) so the
two resolutions of this file stay one shape. The staged-bytes read moved after the
staging write and before the mode copy, so a restrictive target mode cannot turn the
capture into a failure.
Verification, pinned node v22.23.4 (box node is 25.9.0): misc shard exit 0 with 2116
passed / 17 skipped, identical tallies to before the change, and it cannot prove the
three rows because windows skips them; tsc -p src/tsconfig.json exit 0; prettier
--check clean; eslint --max-warnings=0 exit 0; tree clean at this commit. The ubuntu
leg that found the rows is the arbiter for them.
Refs: Zoo-Code-Org#1375, Zoo-Code-Org#1991, Zoo-Code-Org#2019.1 parent e3d6327 commit 8fa7d85
1 file changed
Lines changed: 43 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | | - | |
386 | | - | |
387 | | - | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
388 | 393 | | |
389 | | - | |
390 | | - | |
391 | 394 | | |
392 | 395 | | |
393 | 396 | | |
394 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
395 | 405 | | |
396 | 406 | | |
397 | 407 | | |
| |||
569 | 579 | | |
570 | 580 | | |
571 | 581 | | |
572 | | - | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
573 | 609 | | |
574 | 610 | | |
575 | 611 | | |
| |||
0 commit comments