Details
-
Bug
-
Status: Done
-
Medium
-
Resolution: Fixed
-
1.7.0
-
None
-
None
-
Yes
-
Yes
Description
Hi,
If storage is set to filesystem, pbm status fails with error.
pbm statusĀ Error: get status of backups: get PITR chunks: get chunks list: walking the path: open /tmp/local_backups/pbmPitr: permission denied
It's caused by the fact that directory permissions were stricten, so now pbm cli (which usually runs under some random user) doesn't have access to directory.
commit 7f094e2e48d0ad804e5f76593737c200db1f8a67 diff --git a/pbm/storage/fs/fs.go b/pbm/storage/fs/fs.go index f8df5a81..1ed138be 100644 --- a/pbm/storage/fs/fs.go +++ b/pbm/storage/fs/fs.go @@ -40 +40 @@ func (fs *FS) Save(name string, data io.Reader, _ int) error { - err := os.MkdirAll(path.Dir(filepath), os.ModeDir|0775) + err := os.MkdirAll(path.Dir(filepath), os.ModeDir|0700) @@ -49 +49,2 @@ func (fs *FS) Save(name string, data io.Reader, _ int) error { - err = os.Chmod(filepath, 0664) + defer fw.Close() + err = os.Chmod(filepath, 0600)