Repository navigation
Commit 4dfc2d6
committed
fix(log-guard): accept the OS's own canonical spelling on Windows
Windows CI reported 22 Log Guard failures, all resolving to unsafe_path. The
feature (#1729) is new in this release range and has never shipped, so this is
a release blocker rather than a pre-existing break.
realpathSync.native on Windows expands 8.3 short components — the RUNNER~1 form
that appears throughout %TEMP% — so the canonical realpath and the requested
path disagree as strings while naming the same file. databasePathIsSafe read
that disagreement as an ancestor-symlink redirection and refused every
mutation: protect, unprotect, repair, reclaim, compact.
macOS had the same class of problem with /var and /tmp and was given an
explicit alias normalizer. Windows was not.
The fix keeps the check identity-based rather than string-based: when the
spellings differ, the requested path is re-canonicalized through the same call
and the two canonical forms must agree. A genuine symlink or junction resolves
somewhere else and still fails, so the guard refuses exactly what it was built
to refuse. It is scoped to win32 and cannot change any POSIX verdict.
Regression tests cover all three directions: an OS-canonicalized spelling is
the same file, a symlinked database is not, and an unrelated sibling is not.
Refs #1729
Found by reading the Windows shard logs rather than assuming the leg was
broken. It sat behind 3 failures of my own — POSIX mode assertions that do not
apply on Windows, fixed separately in #2139 — which is why it took a second
pass to see.1 parent 75251bb commit 4dfc2d6
2 files changed
Lines changed: 76 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
39 | 65 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
0 commit comments