diff options
author | Jakob Unterwurzacher | 2020-08-15 17:31:25 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2020-08-15 17:31:45 +0200 |
commit | 94e8fc12ea5756a130e7ac9ed67ddd519b5f3a22 (patch) | |
tree | 44186807f71db8c555af23f8969f8f1456c955f9 /internal/fusefrontend_reverse/node_dir_ops.go | |
parent | 15b0b4a5fd268b421ddc347e4417b2538a540922 (diff) |
v2api/reverse: finish -exclude
Tests pass now.
Diffstat (limited to 'internal/fusefrontend_reverse/node_dir_ops.go')
-rw-r--r-- | internal/fusefrontend_reverse/node_dir_ops.go | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/internal/fusefrontend_reverse/node_dir_ops.go b/internal/fusefrontend_reverse/node_dir_ops.go index 5ec1e95..22f8122 100644 --- a/internal/fusefrontend_reverse/node_dir_ops.go +++ b/internal/fusefrontend_reverse/node_dir_ops.go @@ -23,15 +23,15 @@ import ( // This function is symlink-safe through use of openBackingDir() and // ReadDirIVAt(). func (n *Node) Readdir(ctx context.Context) (stream fs.DirStream, errno syscall.Errno) { - dirfd, cName, errno := n.prepareAtSyscall("") + d, errno := n.prepareAtSyscall("") if errno != 0 { return } - defer syscall.Close(dirfd) + defer syscall.Close(d.dirfd) // Read plaintext directory var entries []fuse.DirEntry - fd, err := syscallcompat.Openat(dirfd, cName, syscall.O_RDONLY|syscall.O_DIRECTORY|syscall.O_NOFOLLOW, 0) + fd, err := syscallcompat.Openat(d.dirfd, d.pName, syscall.O_RDONLY|syscall.O_DIRECTORY|syscall.O_NOFOLLOW, 0) if err != nil { return nil, fs.ToErrno(err) } @@ -42,21 +42,20 @@ func (n *Node) Readdir(ctx context.Context) (stream fs.DirStream, errno syscall. } rn := n.rootNode() + + // Filter out excluded entries + entries = rn.excludeDirEntries(d, entries) + if rn.args.PlaintextNames { return n.readdirPlaintextnames(entries) } - // Filter out excluded entries - //TODO - //entries = rfs.excludeDirEntries(relPath, entries) - // Virtual files: at least one gocryptfs.diriv file virtualFiles := []fuse.DirEntry{ {Mode: virtualFileMode, Name: nametransform.DirIVFilename}, } - cipherPath := n.Path() - dirIV := pathiv.Derive(cipherPath, pathiv.PurposeDirIV) + dirIV := pathiv.Derive(d.cPath, pathiv.PurposeDirIV) // Encrypt names for i := range entries { var cName string |