You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a5354d3
Browse filesBrowse the repository at this point in the historyBrowse files
fix(root): verify restrictive-mode writes through retained descriptors (#154)
* fix(root): verify restrictive-mode writes through retained descriptors
Retain the published descriptor through Root verification while preserving exact identity, link, and confinement checks. Avoid a read reopen failure after the mode-000 file has already been published.
* fix(root): preserve Windows opaque-path verification
Reopen paths through the guarded reader only when Windows pathname identity is unavailable, then compare the fresh descriptor against the original retained bigint identity. Keep POSIX mode-000 verification unchanged.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@
5
5
### Security and Correctness
6
6
7
7
- Preserve underlying command diagnostics (command, timing, timeout flag, exit code/signal, and sanitized stderr) and cause on Windows ACL `permission-unverified` errors without changing verification semantics.
8
+
- Verify `Root.write()` and `create()` through retained descriptors and exact bigint identities for restrictive final modes, retaining guarded Windows path opens when pathname identity is unavailable; preserve explicit mode zero in `copyIn()`.
8
9
- Preserve filesystem failures from `ensureDirectoryWithinRoot()` and `pathScope().ensureDir()` in an optional operational `FsSafeError` diagnostic with the original cause and bounded, escaped display text, instead of misreporting them as containment violations; keep nonthrowing string results and directory safety checks.
9
10
- Accept bounded local PAX paths, sizes, and descriptive metadata, including inert binary macOS provenance xattrs, consistently in JavaScript and native TAR extraction/reads; reject ambiguous records, extension chains, and sparse semantics while retaining byte/count limits and guarded staging. Return TAR read traversal failures through the public promise instead of escaping the parser callback.
10
11
- Add native-required Linux/macOS `stageFileInDirectory()` under `advanced` with retained-directory abort cleanup, private `0600` staging until publication is identity-checked, exact identity checks, explicit publication/cleanup receipts, and async disposal; share that ownership with POSIX native streaming writes so parent moves no longer strand their unpublished temps.
`data` accepts `string | Buffer`. `options` are `{ denyMutations?: DenyMutationPolicy; encoding?: BufferEncoding; mkdir?: boolean; mode?: number; overwrite?: boolean; renameIdentity?: RenameIdentityPolicy }`. `mode` sets the file's POSIX mode. If neither the call nor `RootDefaults` supplies it, a replacement preserves the existing file mode and a new file uses `0o600`. `mkdir` and `overwrite` both default to `true`; set `overwrite: false` for the same no-clobber behavior as `create()`.
66
70
71
+
POSIX modes without read permission, including `0o000` and `0o200`, succeed:
72
+
final verification uses a descriptor retained by the writer rather than reopening
73
+
the published file. The requested mode is not relaxed for verification.
74
+
Publication verification compares exact bigint descriptor and pathname identities,
75
+
including large file indexes that cannot be represented by a JavaScript number.
76
+
Later reads still obey OS permissions, and access checks on a pre-existing
77
+
destination are unchanged. The explicit FUSE compatibility policy still requires
78
+
a readable destination to prove matching content when rename changes its identity.
79
+
80
+
When Windows cannot report a pathname's identity, verification retains the guarded
81
+
reader fallback: reopen the name and compare that descriptor's exact identity with
82
+
the original retained file. Unknown pathname metadata is not proof that the name
83
+
still refers to the published file.
84
+
67
85
### `fs.create(rel, data, options?)`
68
86
69
87
Don't-clobber variant of `write()`. Throws `already-exists` if the target is there.
0 commit comments