diff --git a/pkg/client/fs/fs.go b/pkg/client/fs/fs.go index 95677fb5..492921ed 100644 --- a/pkg/client/fs/fs.go +++ b/pkg/client/fs/fs.go @@ -122,11 +122,17 @@ func (f *fsClient) Put(size int64, data io.Reader) *probe.Error { objectPath := f.PathURL.Path if objectDir != "" { if err := os.MkdirAll(objectDir, 0700); err != nil { + if os.IsPermission(err) { + return probe.NewError(client.PathInsufficientPermission{Path: f.PathURL.Path}) + } return probe.NewError(err) } } fs, err := os.Create(objectPath) if err != nil { + if os.IsPermission(err) { + return probe.NewError(client.PathInsufficientPermission{Path: f.PathURL.Path}) + } return probe.NewError(err) } defer fs.Close()