fix(bin): canonicalize Windows drive-letter herdr socket paths before identity comparison - #2918
fix(bin): canonicalize Windows drive-letter herdr socket paths before identity comparison#29183min-lang wants to merge 2 commits into
Conversation
… identity comparison
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (2): Last reviewed commit: "test(herdr): cover Windows drive-letter ..." | Re-trigger Greptile |
Adds the regression coverage the review asked for. `cygpath` ships only with Git for Windows, so the cases stub it and therefore run on every platform; the adapter guard matches only `[A-Za-z]:[\/]*`, a shape that cannot occur on Linux or macOS. Three cases: a drive-letter spelling normalizes to the same identity as the POSIX spelling of the same socket, a failed `cygpath` is refused rather than compared half-converted, and empty `cygpath` output is refused. Verified the cases fail for the right reason: with the guard removed, the normalization case reports an empty identity against the expected POSIX path.
|
Added the regression coverage in Three cases in
I checked the cases can fail for the right reason rather than just passing: with the guard removed, the normalization case reports an empty identity against the expected POSIX path. One note in case you see it on your side too. On this host 🤖 Generated with Claude Code |
Problem
On native Windows the herdr server injects and reports drive-letter socket
paths (
C:\Users\...\herdr.sock), while the launcher's claimed socket arrivesin POSIX spelling.
fm_backend_herdr_socket_identitycompares the twoliterally, so the same socket compares unequal. That comparison is the single
owner for the presentation session lock and the launcher-identity
same-session proof, so both reject a socket that is in fact their own.
Fix
Convert a drive-letter path to its POSIX spelling with
cygpath -ubefore theexisting directory resolution, so both sides land in the same form.
The
caseguard matches only[A-Za-z]:[\/]*, a shape that cannot occur onLinux or macOS, so
cygpathis never invoked there and behaviour on thoseplatforms is unchanged. An unresolvable drive-letter path returns 1 rather than
comparing a half-converted string.
Testing and scope
bin/fm-lint.sh bin/backends/herdr.shclean.main:fm_backend_herdr_socket_identitystill comparesthe two spellings literally, so the mismatch this fixes is still present.
Scope note, stated because it limits what this PR can be said to fix: on the
Windows host where this was found,
fm_backend_herdr_presentation_session_lock_pathfails earlier, at
fm_backend_herdr_presentation_lock_namespace_valid, whichrequires mode
700. Git Bash mounts both/cand/tmpwithnoacl, somkdir -m 700is a silent no-op there and the namespace directory reads755.That is a separate defect with a separate cause, and this PR does not address
it. So this change is offered as a correctness fix to the identity comparison
itself, not as an end-to-end repair of presentation locking on Windows.
🤖 Generated with Claude Code