]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix file permissions
authorIan Bishop <ianbishop@pace7.com>
Sat, 9 Jun 2018 13:11:28 +0000 (15:11 +0200)
committerIan Bishop <ianbishop@pace7.com>
Sat, 9 Jun 2018 13:11:28 +0000 (15:11 +0200)
storage/file.go

index 25621b1f7f74f42c4bfebd2c1da1b9c8c59f23df..dd22a0516ecdf97260135f455fb00abc0cc1d1bb 100644 (file)
@@ -107,7 +107,7 @@ func CreateNativeZeroLengthFiles(info *metainfo.Info, dir string) (err error) {
                        continue
                }
                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
                f, err = os.Create(name)
                if err != nil {
@@ -192,9 +192,9 @@ func (fst fileTorrentImplIO) WriteAt(p []byte, off int64) (n int, err error) {
                        n1 = int(fi.Length - off)
                }
                name := fst.fts.fileInfoName(fi)
-               os.MkdirAll(filepath.Dir(name), 0770)
+               os.MkdirAll(filepath.Dir(name), 0777)
                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 {
                        return
                }