Skip to content

fix(daemon): reject over-long socket paths with a clear error#26

Merged
alexngai merged 1 commit into
mainfrom
tac-optimization
Jul 9, 2026
Merged

fix(daemon): reject over-long socket paths with a clear error#26
alexngai merged 1 commit into
mainfrom
tac-optimization

Conversation

@alexngai

@alexngai alexngai commented Jul 9, 2026

Copy link
Copy Markdown
Owner

A Unix socket path longer than the platform's sun_path buffer (104 bytes on macOS/BSD, 108 on Linux) is silently truncated by the kernel on bind(), colliding otherwise-distinct daemons onto one socket file and surfacing as a bogus EADDRINUSE. Deeply-nested checkouts hit this on macOS, and the raw failure gives no hint why.

IPCServer.start() now checks the resolved socket path against the platform limit before bind() and throws a clear IPC_ERROR (byte count, platform limit, offending path, remedy) — the single chokepoint both the single- and multi-location daemon flows funnel through. New exported maxSocketPathBytes() helper + tests (per-platform limits, over-long rejection).

Summary

Changes

Testing

  • npm run lint passes
  • npm run build passes
  • npm test passes
  • Added/updated tests for the change
  • Updated docs (README / docs/) if behavior or the public API changed

Related issues

A Unix socket path longer than the platform's sun_path buffer (104 bytes
on macOS/BSD, 108 on Linux) is silently truncated by the kernel on
bind(), colliding otherwise-distinct daemons onto one socket file and
surfacing as a bogus EADDRINUSE. Deeply-nested checkouts hit this on
macOS, and the raw failure gives no hint why.

IPCServer.start() now checks the resolved socket path against the
platform limit before bind() and throws a clear IPC_ERROR (byte count,
platform limit, offending path, remedy) — the single chokepoint both the
single- and multi-location daemon flows funnel through. New exported
maxSocketPathBytes() helper + tests (per-platform limits, over-long
rejection).
@alexngai
alexngai merged commit dd21c95 into main Jul 9, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant