fix(filesystem): bound and verify admitted file and JSON reads

This commit is contained in:
morluto
2026-10-11 00:28:24 +08:00
parent 6d8f95e38d
commit abb8e81d3a
8 changed files with 268 additions and 59 deletions
+9
View File
@@ -16,6 +16,15 @@ export class NonRegularFileReadError extends Error {
}
}
/** A regular input no longer matches the extent or identity admitted for reading. */
export class RegularFileChangedError extends Error {
readonly code = "ESTALE";
constructor(readonly path: string) {
super(`Selected input changed while being read: ${path}`);
this.name = "RegularFileChangedError";
}
}
/** One admitted file descriptor and the metadata that identified its contents. */
export interface StableRegularFileDescriptor {
readonly handle: FileHandle;