diff --git a/cmd/syncthing/config.go b/cmd/syncthing/config.go index f0c7ecce..e4c87486 100644 --- a/cmd/syncthing/config.go +++ b/cmd/syncthing/config.go @@ -33,7 +33,6 @@ type NodeConfiguration struct { type OptionsConfiguration struct { ListenAddress []string `xml:"listenAddress" default:":22000" ini:"listen-address"` ReadOnly bool `xml:"readOnly" ini:"read-only"` - FollowSymlinks bool `xml:"followSymlinks" default:"true" ini:"follow-symlinks"` GUIEnabled bool `xml:"guiEnabled" default:"true" ini:"gui-enabled"` GUIAddress string `xml:"guiAddress" default:"127.0.0.1:8080" ini:"gui-address"` GlobalAnnServer string `xml:"globalAnnounceServer" default:"announce.syncthing.net:22025" ini:"global-announce-server"` diff --git a/cmd/syncthing/config_test.go b/cmd/syncthing/config_test.go index da493ae3..910c3750 100644 --- a/cmd/syncthing/config_test.go +++ b/cmd/syncthing/config_test.go @@ -11,7 +11,6 @@ func TestDefaultValues(t *testing.T) { expected := OptionsConfiguration{ ListenAddress: []string{":22000"}, ReadOnly: false, - FollowSymlinks: true, GUIEnabled: true, GUIAddress: "127.0.0.1:8080", GlobalAnnServer: "announce.syncthing.net:22025", @@ -70,7 +69,6 @@ func TestOverriddenValues(t *testing.T) { :23000 true false - false false 125.2.2.2:8080 syncthing.nym.se:22025 @@ -89,7 +87,6 @@ func TestOverriddenValues(t *testing.T) { expected := OptionsConfiguration{ ListenAddress: []string{":23000"}, ReadOnly: true, - FollowSymlinks: false, GUIEnabled: false, GUIAddress: "125.2.2.2:8080", GlobalAnnServer: "syncthing.nym.se:22025", diff --git a/cmd/syncthing/model.go b/cmd/syncthing/model.go index fb827cf1..993702dc 100644 --- a/cmd/syncthing/model.go +++ b/cmd/syncthing/model.go @@ -557,7 +557,6 @@ func (m *Model) ScanRepo(repo string) { w := &scanner.Walker{ Dir: m.repoDirs[repo], IgnoreFile: ".stignore", - FollowSymlinks: cfg.Options.FollowSymlinks, BlockSize: BlockSize, TempNamer: defTempNamer, Suppressor: sup, diff --git a/scanner/walk.go b/scanner/walk.go index d8bf3442..a5dee39f 100644 --- a/scanner/walk.go +++ b/scanner/walk.go @@ -16,9 +16,6 @@ import ( type Walker struct { // Dir is the base directory for the walk Dir string - // If FollowSymlinks is true, symbolic links directly under Dir will be followed. - // Symbolic links at deeper levels are never followed regardless of this flag. - FollowSymlinks bool // BlockSize controls the size of the block used when hashing. BlockSize int // If IgnoreFile is not empty, it is the name used for the file that holds ignore patterns. @@ -58,7 +55,7 @@ func (w *Walker) Walk() (files []File, ignore map[string][]string) { w.lazyInit() if debug { - dlog.Println("Walk", w.Dir, w.FollowSymlinks, w.BlockSize, w.IgnoreFile) + dlog.Println("Walk", w.Dir, w.BlockSize, w.IgnoreFile) } t0 := time.Now() @@ -68,27 +65,6 @@ func (w *Walker) Walk() (files []File, ignore map[string][]string) { filepath.Walk(w.Dir, w.loadIgnoreFiles(w.Dir, ignore)) filepath.Walk(w.Dir, hashFiles) - if w.FollowSymlinks { - d, err := os.Open(w.Dir) - if err != nil { - return - } - defer d.Close() - - fis, err := d.Readdir(-1) - if err != nil { - return - } - - for _, info := range fis { - if info.Mode()&os.ModeSymlink != 0 { - dir := filepath.Join(w.Dir, info.Name()) + "/" - filepath.Walk(dir, w.loadIgnoreFiles(dir, ignore)) - filepath.Walk(dir, hashFiles) - } - } - } - if debug { t1 := time.Now() d := t1.Sub(t0).Seconds()