From 631974f9e04fc0ceb1fe859c3e68432b76197c3b Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 8 Dec 2017 06:16:16 +0100 Subject: fusefrontend_reverse: Use O_DIRECTORY in OpenDir implementation Also get rid of the defer - it is not really necessary here. --- internal/fusefrontend_reverse/rfs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal') 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) } -- cgit v1.2.3