Fix backup crash on macOS when directories contain socket files#34
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ds pull --applycrashing when backed-up directories contain Unix socket files on macOSsun_pathlimit causedFileUtils.cp_rto failCloses #33
Changes
Code
lib/dotsync/actions/pull_action.rb: ReplaceFileUtils.cp_rwithcp_r_regular_files— a recursive copy that skips sockets, FIFOs, and device files while preserving symlinks and file metadataTests
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 backupRelease
lib/dotsync/version.rb: 0.4.0 → 0.4.1CHANGELOG.md: Add 0.4.1 entryGemfile.lock: Version bumpTest plan
bundle exec rspec— full suite passesbundle exec rubocop— no offenses🤖 Generated with Claude Code