mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 09:34:03 +08:00
Merge pull request #3964 from MichaelMure/filestore_root
Filestore: more verbose error when adding a file from outside of the root
This commit is contained in:
@ -211,7 +211,7 @@ func (f *FileManager) putTo(b *posinfo.FilestoreNode, to putter) error {
|
|||||||
var dobj pb.DataObj
|
var dobj pb.DataObj
|
||||||
|
|
||||||
if !filepath.HasPrefix(b.PosInfo.FullPath, f.root) {
|
if !filepath.HasPrefix(b.PosInfo.FullPath, f.root) {
|
||||||
return fmt.Errorf("cannot add filestore references outside ipfs root")
|
return fmt.Errorf("cannot add filestore references outside ipfs root (%s)", f.root)
|
||||||
}
|
}
|
||||||
|
|
||||||
p, err := filepath.Rel(f.root, b.PosInfo.FullPath)
|
p, err := filepath.Rel(f.root, b.PosInfo.FullPath)
|
||||||
|
Reference in New Issue
Block a user