lib/osutil: Don't chmod in atomic file creation (fixes #2472)

Instead, trust (and test) that the temp file has appropriate permissions
from the start. The only place where this changes our behavior is for
ignores which go from 0644 to 0600. I'm OK with that.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3756
This commit is contained in:
Jakob Borg authored and Audrius Butkevicius committed 2016-11-23 14:06:08 +00:00
1 parent 26730eb083
commit 8559e20237
6 files changed
+57 -17

No files matched your search

+1 -1
View File
@@ -116,7 +116,7 @@ func saveCsrfTokens() {
// nothing relevant we can do about them anyway...
name := locations[locCsrfTokens]
f, err := osutil.CreateAtomic(name, 0600)
f, err := osutil.CreateAtomic(name)
if err != nil {
return
}