From 3ee12464b4fec0eb7d9fc250d1fad933ef86c91b Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 20 Sep 2017 06:49:04 +0000 Subject: [PATCH] lib/config, lib/model: Make sure to hide our special files (fixes #4382) The folder marker conversion forgot to hide the .stfolder. This adds that, for those who have not yet been converted. Also adds Hide() calls to the folder start, to mend historical unhidedness. (I'm sure this will upset someone who is manually managing their .stignores in the other direction...) GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4384 --- lib/config/config.go | 1 + lib/model/model.go | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/config/config.go b/lib/config/config.go index c58a4a32..3c142d98 100644 --- a/lib/config/config.go +++ b/lib/config/config.go @@ -392,6 +392,7 @@ func convertV22V23(cfg *Configuration) { err = fs.Remove(".stfolder") if err == nil { err = fs.Mkdir(".stfolder", permBits) + fs.Hide(".stfolder") // ignore error } if err != nil { l.Fatalln("failed to upgrade folder marker:", err) diff --git a/lib/model/model.go b/lib/model/model.go index 72356e19..7af6f39c 100644 --- a/lib/model/model.go +++ b/lib/model/model.go @@ -253,7 +253,14 @@ func (m *Model) startFolderLocked(folder string) config.FolderType { } } - p := folderFactory(m, cfg, ver, fs.MtimeFS()) + ffs := fs.MtimeFS() + + // These are our metadata files, and they should always be hidden. + ffs.Hide(".stfolder") + ffs.Hide(".stversions") + ffs.Hide(".stignore") + + p := folderFactory(m, cfg, ver, ffs) m.folderRunners[folder] = p m.warnAboutOverwritingProtectedFiles(folder)