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:
committed by
Audrius Butkevicius
parent
26730eb083
commit
8559e20237
@@ -1248,7 +1248,7 @@ func (m *Model) SetIgnores(folder string, content []string) error {
|
||||
|
||||
path := filepath.Join(cfg.Path(), ".stignore")
|
||||
|
||||
fd, err := osutil.CreateAtomic(path, 0644)
|
||||
fd, err := osutil.CreateAtomic(path)
|
||||
if err != nil {
|
||||
l.Warnln("Saving .stignore:", err)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user