aboutsummaryrefslogtreecommitdiff
path: root/src/workspace
diff options
context:
space:
mode:
authormoonsphere <43288455+moonsphere@users.noreply.github.com>2026-05-12 19:08:41 +0800
committerGitHub <noreply@github.com>2026-05-12 14:08:41 +0300
commit8f747e96ebe079ce60cadcd6931e195295b0ca1c (patch)
tree860d59fe8140fce8079c2a236be6418cfffc6f34 /src/workspace
parentbcea1d884a959a9865a9a85aad4589f5b0853d2b (diff)
fix(remote): keep bridge socket path under sun_path ceiling (#103)
local_forward_socket_path built {TMPDIR}/herdr-remote-{pid}-{target}- {session}.sock. On macOS std::env::temp_dir() returns /var/folders/.../T/ (~49 chars), so a ~24-char target was enough to push the path past sun_path's 104-byte ceiling and UnixListener::bind rejected it with "path must be shorter than SUN_LEN". Per-component sanitization capped each piece at 32 chars but ignored the directory prefix. The function now picks the first form that fits within 103 bytes (one byte of headroom for the trailing NUL; portable across macOS' 104 and Linux's 108) measured via OsStrExt::as_bytes: 1. Readable name in TMPDIR (unchanged when it fits). 2. Hashed short name in TMPDIR. 3. Hashed short name in /tmp (rare fallback for over-long TMPDIRs). The hash covers the full unsanitized target/session so uniqueness does not depend on prefix truncation; the truncated prefix is kept only for debuggability of the short-form filename. Co-authored-by: jett <jett@pingcap.cn> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'src/workspace')
0 files changed, 0 insertions, 0 deletions