cammount: check that input is a directory blobref

Change-Id: I9b33f2ae31ef902e01ddaa0504e1c960bb4e3640
This commit is contained in:
mpl 2012-10-18 00:33:37 +02:00
parent 0b15eb0cc8
commit 2d4f37176c
1 changed files with 3 additions and 0 deletions

View File

@ -82,6 +82,9 @@ func NewRootedCamliFileSystem(fetcher blobref.SeekFetcher, root *blobref.BlobRef
if err != nil {
return nil, err
}
if ss.Type != "directory" {
return nil, fmt.Errorf("Blobref must be of a directory, got a %v", ss.Type)
}
n := &node{fs: fs, blobref: root, ss: ss}
n.populateAttr()
fs.root = n