diff options
author | Jakob Unterwurzacher | 2021-07-31 10:53:32 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2021-07-31 10:53:32 +0200 |
commit | 1dfd6b7b765c82c4c9cf6d41ec6d6ed5f6cb2a79 (patch) | |
tree | 990a51fb99bea3049352ec594f4da108194de678 /internal | |
parent | 0ca302f12aa8be391d6b8e7081b5c75fbec2e872 (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')
-rw-r--r-- | internal/fusefrontend/node_prepare_syscall.go | 3 |
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 { |