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.
This commit is contained in:
Jakob Unterwurzacher 2021-07-31 10:53:32 +02:00
parent 0ca302f12a
commit 1dfd6b7b76
1 changed files with 3 additions and 0 deletions

View File

@ -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 {