Fix file permissions

This commit is contained in:
Ian Bishop 2018-06-09 15:11:28 +02:00
parent f6ed514c3b
commit ffd41230a6
1 changed files with 3 additions and 3 deletions

View File

@ -107,7 +107,7 @@ func CreateNativeZeroLengthFiles(info *metainfo.Info, dir string) (err error) {
continue continue
} }
name := filepath.Join(append([]string{dir, info.Name}, fi.Path...)...) name := filepath.Join(append([]string{dir, info.Name}, fi.Path...)...)
os.MkdirAll(filepath.Dir(name), 0750) os.MkdirAll(filepath.Dir(name), 0777)
var f io.Closer var f io.Closer
f, err = os.Create(name) f, err = os.Create(name)
if err != nil { if err != nil {
@ -192,9 +192,9 @@ func (fst fileTorrentImplIO) WriteAt(p []byte, off int64) (n int, err error) {
n1 = int(fi.Length - off) n1 = int(fi.Length - off)
} }
name := fst.fts.fileInfoName(fi) name := fst.fts.fileInfoName(fi)
os.MkdirAll(filepath.Dir(name), 0770) os.MkdirAll(filepath.Dir(name), 0777)
var f *os.File var f *os.File
f, err = os.OpenFile(name, os.O_WRONLY|os.O_CREATE, 0660) f, err = os.OpenFile(name, os.O_WRONLY|os.O_CREATE, 0666)
if err != nil { if err != nil {
return return
} }