diff --git a/internal/cache/cache.go b/internal/cache/cache.go index 0b264e256..ca59b0dc0 100644 --- a/internal/cache/cache.go +++ b/internal/cache/cache.go @@ -24,7 +24,7 @@ type Cache struct { } const dirMode = 0700 -const fileMode = 0600 +const fileMode = 0644 func readVersion(dir string) (v uint, err error) { buf, err := ioutil.ReadFile(filepath.Join(dir, "version")) @@ -68,7 +68,7 @@ func writeCachedirTag(dir string) error { return errors.Wrap(err, "Lstat") } - f, err := fs.OpenFile(tagfile, os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0644) + f, err := fs.OpenFile(tagfile, os.O_CREATE|os.O_EXCL|os.O_WRONLY, fileMode) if err != nil { if os.IsExist(errors.Cause(err)) { return nil @@ -138,7 +138,7 @@ func New(id string, basedir string) (c *Cache, err error) { } if v < cacheVersion { - err = ioutil.WriteFile(filepath.Join(cachedir, "version"), []byte(fmt.Sprintf("%d", cacheVersion)), 0644) + err = ioutil.WriteFile(filepath.Join(cachedir, "version"), []byte(fmt.Sprintf("%d", cacheVersion)), fileMode) if err != nil { return nil, errors.Wrap(err, "WriteFile") }