aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-05-29 16:44:38 +0200
committerJakob Unterwurzacher2021-05-29 16:44:38 +0200
commit18befda0e6f1a690fa000951df8f9a4a61daebbb (patch)
treec2251164f04cfae95934e940b2b45680e1165f8d
parent738a9e006af6f5e43871c2d8e208601c18191965 (diff)
fusefrontend: list "." and ".." in dir entries
Fixes xfstests generic/401
-rw-r--r--internal/fusefrontend/node_dir_ops.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/fusefrontend/node_dir_ops.go b/internal/fusefrontend/node_dir_ops.go
index ddffea6..001c23a 100644
--- a/internal/fusefrontend/node_dir_ops.go
+++ b/internal/fusefrontend/node_dir_ops.go
@@ -161,13 +161,12 @@ func (n *Node) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno) {
defer syscall.Close(parentDirFd)
// Read ciphertext directory
- var cipherEntries []fuse.DirEntry
fd, err := syscallcompat.Openat(parentDirFd, cDirName, syscall.O_RDONLY|syscall.O_DIRECTORY|syscall.O_NOFOLLOW, 0)
if err != nil {
return nil, fs.ToErrno(err)
}
defer syscall.Close(fd)
- cipherEntries, err = syscallcompat.Getdents(fd)
+ cipherEntries, specialEntries, err := syscallcompat.GetdentsSpecial(fd)
if err != nil {
return nil, fs.ToErrno(err)
}
@@ -184,6 +183,8 @@ func (n *Node) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno) {
}
// Decrypted directory entries
var plain []fuse.DirEntry
+ // Add "." and ".."
+ plain = append(plain, specialEntries...)
// Filter and decrypt filenames
for i := range cipherEntries {
cName := cipherEntries[i].Name