Merge branch 'thehyve/fix-crunch-documentation' Fix a typo in Crunch Dispatch install...
[arvados.git] / sdk / go / arvados / fs_base.go
index 369b4bb9420b779846304f69662e4596e4cb6d0a..3058a7609c6665dfd22c2ee6bb205685c97afe7d 100644 (file)
@@ -103,6 +103,9 @@ type inode interface {
 
        // Child() performs lookups and updates of named child nodes.
        //
+       // (The term "child" here is used strictly. This means name is
+       // not "." or "..", and name does not contain "/".)
+       //
        // If replace is non-nil, Child calls replace(x) where x is
        // the current child inode with the given name. If possible,
        // the child inode is replaced with the one returned by
@@ -449,7 +452,7 @@ func (fs *fileSystem) Rename(oldname, newname string) error {
        // call nca.FS().Rename() instead of proceeding. Until then
        // it's awkward for filesystems to implement their own Rename
        // methods effectively: the only one that runs is the one on
-       // the root filesystem exposed to the caller (webdav, fuse,
+       // the root FileSystem exposed to the caller (webdav, fuse,
        // etc).
 
        // When acquiring locks on multiple inodes, avoid deadlock by
@@ -586,3 +589,7 @@ func rlookup(start inode, path string) (node inode, err error) {
        }
        return
 }
+
+func permittedName(name string) bool {
+       return name != "" && name != "." && name != ".." && !strings.Contains(name, "/")
+}