1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-30 01:52:26 +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:
Jeromy Johnson
2017-06-08 20:46:23 -07:00
committed by GitHub

View File

@ -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)