summaryrefslogtreecommitdiff
path: root/internal/fusefrontend
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-07-31 10:53:32 +0200
committerJakob Unterwurzacher2021-07-31 10:53:32 +0200
commit1dfd6b7b765c82c4c9cf6d41ec6d6ed5f6cb2a79 (patch)
tree990a51fb99bea3049352ec594f4da108194de678 /internal/fusefrontend
parent0ca302f12aa8be391d6b8e7081b5c75fbec2e872 (diff)
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.
Diffstat (limited to 'internal/fusefrontend')
-rw-r--r--internal/fusefrontend/node_prepare_syscall.go3
1 files changed, 3 insertions, 0 deletions
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 {