diff options
Diffstat (limited to 'internal/fusefrontend')
-rw-r--r-- | internal/fusefrontend/node_helpers.go | 10 | ||||
-rw-r--r-- | internal/fusefrontend/root_node.go | 6 |
2 files changed, 14 insertions, 2 deletions
diff --git a/internal/fusefrontend/node_helpers.go b/internal/fusefrontend/node_helpers.go index b2f1d4a..f2d1e5e 100644 --- a/internal/fusefrontend/node_helpers.go +++ b/internal/fusefrontend/node_helpers.go @@ -121,7 +121,15 @@ func (n *Node) prepareAtSyscall(child string) (dirfd int, cName string, errno sy var iv []byte dirfd, iv = rn.dirCache.Lookup(n) if dirfd > 0 { - cName, err := rn.nameTransform.EncryptAndHashName(child, iv) + var cName string + var err error + if rn.nameTransform.HaveBadnamePatterns() { + //BadName allowed, try to determine filenames + cName, err = rn.nameTransform.EncryptAndHashBadName(child, iv, dirfd) + } else { + cName, err = rn.nameTransform.EncryptAndHashName(child, iv) + } + if err != nil { return -1, "", fs.ToErrno(err) } diff --git a/internal/fusefrontend/root_node.go b/internal/fusefrontend/root_node.go index a830cc4..35b7be0 100644 --- a/internal/fusefrontend/root_node.go +++ b/internal/fusefrontend/root_node.go @@ -245,7 +245,11 @@ func (rn *RootNode) openBackingDir(relPath string) (dirfd int, cName string, err syscall.Close(dirfd) return -1, "", err } - cName, err = rn.nameTransform.EncryptAndHashName(name, iv) + if rn.nameTransform.HaveBadnamePatterns() { + cName, err = rn.nameTransform.EncryptAndHashBadName(name, iv, dirfd) + } else { + cName, err = rn.nameTransform.EncryptAndHashName(name, iv) + } if err != nil { syscall.Close(dirfd) return -1, "", err |