X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8296c0784c70660e0a7247ba000741d37bda38fd..81b8420a261a095a269a46d965b2fc0ee6ecf793:/sdk/go/arvados/fs_base.go diff --git a/sdk/go/arvados/fs_base.go b/sdk/go/arvados/fs_base.go index 369b4bb942..3058a7609c 100644 --- a/sdk/go/arvados/fs_base.go +++ b/sdk/go/arvados/fs_base.go @@ -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, "/") +}