forked from TrueCloudLab/rclone
rcd: Fix permissions problems on cache directory with web gui download
This commit is contained in:
parent
23910ba53b
commit
526a3347ac
1 changed files with 4 additions and 4 deletions
|
@ -82,7 +82,7 @@ func checkRelease(shouldUpdate bool) (err error) {
|
||||||
extractPath := filepath.Join(cachePath, "current")
|
extractPath := filepath.Join(cachePath, "current")
|
||||||
|
|
||||||
if !exists(cachePath) {
|
if !exists(cachePath) {
|
||||||
if err := os.MkdirAll(cachePath, 755); err != nil {
|
if err := os.MkdirAll(cachePath, 0755); err != nil {
|
||||||
fs.Logf(nil, "Error creating cache directory: %s", cachePath)
|
fs.Logf(nil, "Error creating cache directory: %s", cachePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,14 +177,14 @@ func unzip(src, dest string) (err error) {
|
||||||
path := filepath.Join(dest, f.Name)
|
path := filepath.Join(dest, f.Name)
|
||||||
|
|
||||||
if f.FileInfo().IsDir() {
|
if f.FileInfo().IsDir() {
|
||||||
if err := os.MkdirAll(path, f.Mode()); err != nil {
|
if err := os.MkdirAll(path, 0755); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if err := os.MkdirAll(filepath.Dir(path), f.Mode()); err != nil {
|
if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode())
|
f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue