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 194be00
Browse filesBrowse the repository at this point in the historyBrowse files
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
@@ -4,6 +4,7 @@
4
4
5
5
### Security and Correctness
6
6
7
+
- Reject non-file sidecars without spinning, and read contended async and synchronous sidecar locks through bounded, no-follow, identity-checked descriptors; keep valid `createdAt` timestamps authoritative under filesystem clock skew; fail closed when fallback Windows ACL inspection returns no verifiable access entries; preserve synchronous stale-reclaim guards owned by another acquirer; and share one process-exit cleanup listener across file-lock manager domains.
7
8
- Apply `movePathWithCopyFallback()` file and POSIX directory modes through staging descriptors before publication, so a replaceable staging pathname cannot redirect `chmod` to an unrelated symlink target. Windows no longer uses a pathname fallback for directory modes because Node cannot portably open a directory descriptor there and does not enforce POSIX modes.
8
9
9
10
- Reject drive-relative segments such as `C:secret.txt` and `a/C:b` in portable relative-path parsing and every `FileStore` key, and reject leading drive-relative spellings on `Root` destinations and `resolve()` with `invalid-path`. Existing-object Root operations, including reads, inspection, removal, and the source of `move()`, continue to accept legal POSIX filenames such as `c:notes.txt`; thanks @Yigtwxx for the fix.
Copy file name to clipboardExpand all lines: docs/sidecar-lock.md
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,12 @@ type FileLockRetryOptions = {
96
96
result is passed to `shouldReclaim` and `shouldRemoveStaleLock`, allowing PID,
97
97
process-start, argv, or role schemas to remain application-owned.
98
98
99
+
On Windows, a pathed `EPERM` from creating or opening the lock file can be a
100
+
short teardown race after another holder unlinks it. The async lock retries that
101
+
specific denial at most eight times. A parent-directory denial, a denial from a
102
+
callback, or a ninth consecutive lock-file denial surfaces as the original
103
+
`EPERM`; it is not converted to `file_lock_timeout`.
104
+
99
105
## Owner-scoped reentrancy
100
106
101
107
Version 0.5 removes the unsound process-scoped `allowReentrant` boolean and
@@ -167,10 +173,10 @@ progress.
167
173
## Synchronous locks
168
174
169
175
`acquireFileLockSync()` and `withFileLockSync()` mirror filesystem arbitration,
170
-
retry, payload parsing, stale policy, guarded identity-conditioned reclaim,
171
-
verification, and compromise monitoring. They do not use the async manager
172
-
queue, support async callbacks, or provide same-process reentrancy. Retry waits
173
-
block the calling thread; use the async API in request-serving code.
176
+
retry, payload parsing, stale policy, owner-scoped reentrancy, guarded
177
+
identity-conditioned reclaim, verification, and compromise monitoring. They do
178
+
not use the async manager queue or support async callbacks. Retry waits block
179
+
the calling thread; use the async API in request-serving code.
174
180
175
181
Always release in a `finally`:
176
182
@@ -236,7 +242,11 @@ await locks.drain();
236
242
237
243
## Stale policy: `shouldReclaim`
238
244
239
-
The default policy treats locks whose `createdAt` is older than `staleMs` as stale. Pass a custom callback when you want a richer notion of "is the holder still alive":
245
+
The default policy treats locks whose valid `createdAt` is older than `staleMs`
246
+
as stale. A valid current or future timestamp remains authoritative under
247
+
filesystem clock skew; only absent or malformed timestamps fall back to the
248
+
sidecar `mtime`. Pass a custom callback when you want a richer notion of "is the
0 commit comments