From 1dfd6b7b765c82c4c9cf6d41ec6d6ed5f6cb2a79 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 31 Jul 2021 10:53:32 +0200 Subject: [PATCH] fusefrontend: prepareAtSyscall: handle error when opening ourselves Error handling was missing here, so we would later get confusing EBADF errors due to dirfd being -1. --- internal/fusefrontend/node_prepare_syscall.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/fusefrontend/node_prepare_syscall.go b/internal/fusefrontend/node_prepare_syscall.go index 283096f..0894379 100644 --- a/internal/fusefrontend/node_prepare_syscall.go +++ b/internal/fusefrontend/node_prepare_syscall.go @@ -66,6 +66,9 @@ func (n *Node) prepareAtSyscall(child string) (dirfd int, cName string, errno sy defer syscall.Close(parentDirfd) dirfd, err := syscallcompat.Openat(parentDirfd, myCName, syscall.O_NOFOLLOW|syscall.O_DIRECTORY|syscallcompat.O_PATH, 0) + if err != nil { + return -1, "", fs.ToErrno(err) + } // Cache store if !rn.args.PlaintextNames {