mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-10 07:11:08 +00:00
Merge pull request #1513 from kamadak/dir-perm
Preserve the permission of a newly created directory
This commit is contained in:
commit
d12f802027
@ -489,7 +489,11 @@ func (p *rwFolder) handleDir(file protocol.FileInfo) {
|
|||||||
// we can pass it to InWritableDir. We use a regular Mkdir and
|
// we can pass it to InWritableDir. We use a regular Mkdir and
|
||||||
// not MkdirAll because the parent should already exist.
|
// not MkdirAll because the parent should already exist.
|
||||||
mkdir := func(path string) error {
|
mkdir := func(path string) error {
|
||||||
return os.Mkdir(path, mode)
|
err = os.Mkdir(path, mode)
|
||||||
|
if err != nil || p.ignorePerms {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return os.Chmod(path, mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = osutil.InWritableDir(mkdir, realName); err == nil {
|
if err = osutil.InWritableDir(mkdir, realName); err == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user