aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse
diff options
context:
space:
mode:
authorSebastian Lackner2017-12-08 06:16:16 +0100
committerrfjakob2017-12-11 21:18:20 +0100
commit631974f9e04fc0ceb1fe859c3e68432b76197c3b (patch)
tree44ce236f45b11c04496e696b8b5e0dcb80365afb /internal/fusefrontend_reverse
parent96dc2ca70906c831b60be1c6ed3a27dbf7628e72 (diff)
fusefrontend_reverse: Use O_DIRECTORY in OpenDir implementation
Also get rid of the defer - it is not really necessary here.
Diffstat (limited to 'internal/fusefrontend_reverse')
-rw-r--r--internal/fusefrontend_reverse/rfs.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/fusefrontend_reverse/rfs.go b/internal/fusefrontend_reverse/rfs.go
index 220ed37..f9dde19 100644
--- a/internal/fusefrontend_reverse/rfs.go
+++ b/internal/fusefrontend_reverse/rfs.go
@@ -255,12 +255,12 @@ func (rfs *ReverseFS) OpenDir(cipherPath string, context *fuse.Context) ([]fuse.
return nil, fuse.ToStatus(err)
}
// Read plaintext dir
- fd, err := syscallcompat.OpenNofollow(rfs.args.Cipherdir, relPath, syscall.O_RDONLY, 0)
+ fd, err := syscallcompat.OpenNofollow(rfs.args.Cipherdir, relPath, syscall.O_RDONLY|syscall.O_DIRECTORY, 0)
if err != nil {
return nil, fuse.ToStatus(err)
}
- defer syscall.Close(fd)
entries, err := syscallcompat.Getdents(fd)
+ syscall.Close(fd)
if err != nil {
return nil, fuse.ToStatus(err)
}