Skip to content

fix(vm): relocate per-sandbox Unix sockets to /tmp to fit macOS sun_path - #3544

Open
benoitf wants to merge 1 commit into
NVIDIA:mainfrom
benoitf:fix/vm-socket-sun-path
Open

benoitf wants to merge 1 commit into
NVIDIA:mainfrom
benoitf:fix/vm-socket-sun-path

Conversation

@benoitf

@benoitf benoitf commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Move VM driver per-sandbox Unix sockets (control.sock, ssh.sock) from the
state directory to /tmp/openshell/sandboxes/{sandbox-id}/ so that socket paths
stay within the 104-byte macOS sun_path limit regardless of home directory depth.

Related Issue

Closes #3452

Changes

  • Add sandbox_socket_dir() helper returning /tmp/openshell/sandboxes/{sandbox-id}
    (hardcoded /tmp because macOS TMPDIR resolves to ~51-char /var/folders/…/T/
    which would re-exceed the limit)
  • /tmp/openshell/sandboxes/ created with 0o1777 (sticky, multi-user safe);
    per-sandbox dirs remain 0o700
  • control.sock and ssh.sock paths updated to use the new socket directory
  • Socket directory cleanup added to all teardown paths: create_sandbox early
    errors, provision_sandbox cancellation, fail_provisioning, and delete_sandbox
  • Socket dir also created in provision_sandbox_inner for the restoration path

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Move control.sock and ssh.sock from the per-sandbox state directory
to /tmp/openshell/sandboxes/{sandbox-id}/ so that socket paths stay
within the 104-byte macOS sun_path limit regardless of the user's
home directory depth.

Closes NVIDIA#3452

Signed-off-by: Florent Benoit <fbenoit@redhat.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

This branch has not been deployed

No deployments
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.

bug(vm): per-sandbox Unix socket paths exceed macOS sun_path limit

1 participant