Skip to content

Fix backup crash on macOS when directories contain socket files#34

Merged
dsaenztagarro merged 1 commit into
masterfrom
33-fix-backup-socket-crash
Mar 16, 2026
Merged

Fix backup crash on macOS when directories contain socket files#34
dsaenztagarro merged 1 commit into
masterfrom
33-fix-backup-socket-crash

Conversation

@dsaenztagarro
Copy link
Copy Markdown
Owner

Summary

  • Fix ds pull --apply crashing when backed-up directories contain Unix socket files on macOS
  • Socket paths exceeding the 104-byte sun_path limit caused FileUtils.cp_r to fail
  • Bump version to 0.4.1

Closes #33

Changes

Code

  • lib/dotsync/actions/pull_action.rb: Replace FileUtils.cp_r with cp_r_regular_files — a recursive copy that skips sockets, FIFOs, and device files while preserving symlinks and file metadata

Tests

  • spec/dotsync/actions/pull_action_spec.rb: Add spec that creates a real Unix socket in the dest directory and verifies it is skipped during backup

Release

  • lib/dotsync/version.rb: 0.4.0 → 0.4.1
  • CHANGELOG.md: Add 0.4.1 entry
  • Gemfile.lock: Version bump

Test plan

  • bundle exec rspec — full suite passes
  • bundle exec rubocop — no offenses
  • New socket-skipping spec verifies the fix directly

🤖 Generated with Claude Code

Replace FileUtils.cp_r with custom cp_r_regular_files that skips
sockets, FIFOs, and device files during backup. Socket paths exceeding
the macOS 104-byte sun_path limit no longer cause backup failures.

Closes #33

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dsaenztagarro dsaenztagarro merged commit db72591 into master Mar 16, 2026
2 checks passed
@dsaenztagarro dsaenztagarro deleted the 33-fix-backup-socket-crash branch March 16, 2026 23:49
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.

Fix backup crash on macOS when directories contain socket files

1 participant