mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
Don't unnecessarily chmod directories when renaming
This commit is contained in:
parent
010d5a0192
commit
9a50c4d93f
@ -43,8 +43,8 @@ func Rename(from, to string) error {
|
|||||||
|
|
||||||
// Make sure the destination directory is writeable
|
// Make sure the destination directory is writeable
|
||||||
toDir := filepath.Dir(to)
|
toDir := filepath.Dir(to)
|
||||||
if info, err := os.Stat(toDir); err == nil {
|
if info, err := os.Stat(toDir); err == nil && info.IsDir() && info.Mode()&0200 == 0 {
|
||||||
os.Chmod(toDir, 0777)
|
os.Chmod(toDir, 0755)
|
||||||
defer os.Chmod(toDir, info.Mode())
|
defer os.Chmod(toDir, info.Mode())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user