Merge pull request #1513 from kamadak/dir-perm

Preserve the permission of a newly created directory
This commit is contained in:
Jakob Borg 2015-03-24 21:09:48 +01:00
commit d12f802027

View File

@ -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 {