Skip to content

Commit

Permalink
Disabled symlinks as synchronization roots.
Browse files Browse the repository at this point in the history
This is a breaking but necessary change. There's not really any way to
support this that doesn't involve horrendous (and probably not 100%
correct) hacks. The main problems are (a) watches can't catch changes to
symlinks and (b) symlink roots that point to non-existent files will
fail with "already exist" errors when propagating the root from the
other side and (c) symlink roots that DO exist will have the symlink
itself wiped out when changes are propagated from the other side.

Existing sessions with symlink roots will just enter a "waiting for
rescan" failure because scans will consistently fail. No data will be
lost.
  • Loading branch information
xenoscopic committed Nov 16, 2017
1 parent d3082e8 commit da66889
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sync/scan.go
Expand Up @@ -221,9 +221,8 @@ func Scan(root string, hasher hash.Hash, cache *Cache, ignores []string) (*Entry
buffer: make([]byte, scannerCopyBufferSize),
}

// Create the snapshot. We use os.Stat, as opposed to os.Lstat, because we
// DO want to follow symbolic links at the root.
if info, err := os.Stat(root); err != nil {
// Create the snapshot.
if info, err := os.Lstat(root); err != nil {
if os.IsNotExist(err) {
return nil, newCache, nil
} else {
Expand Down

0 comments on commit da66889

Please sign in to comment.