diff options
author | Sebastian Lackner | 2017-12-07 18:36:52 +0100 |
---|---|---|
committer | rfjakob | 2017-12-07 23:36:11 +0100 |
commit | ad0f1101917ab011128ae07df79deee81a2626c7 (patch) | |
tree | 5965a45e86bea55792d583071e7a019da5b2a7fc | |
parent | 48bd59f38843e5ebd4e4c9f666f1aea1c9990803 (diff) |
fusefrontend_reverse: Use openBackingDir in Readlink
-rw-r--r-- | internal/fusefrontend_reverse/rfs.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/internal/fusefrontend_reverse/rfs.go b/internal/fusefrontend_reverse/rfs.go index 3ac626f..48a9bfe 100644 --- a/internal/fusefrontend_reverse/rfs.go +++ b/internal/fusefrontend_reverse/rfs.go @@ -327,18 +327,13 @@ func (rfs *ReverseFS) StatFs(path string) *fuse.StatfsOut { // Readlink - FUSE call func (rfs *ReverseFS) Readlink(relPath string, context *fuse.Context) (string, fuse.Status) { - // Decrypt path to "plaintext relative path" - pRelPath, err := rfs.decryptPath(relPath) + dirfd, name, err := rfs.openBackingDir(relPath) if err != nil { return "", fuse.ToStatus(err) } // read the link target using Readlinkat - dirFd, err := syscallcompat.OpenNofollow(rfs.args.Cipherdir, filepath.Dir(pRelPath), syscall.O_RDONLY|syscall.O_DIRECTORY, 0) - if err != nil { - return "", fuse.ToStatus(err) - } - plainTarget, err := syscallcompat.Readlinkat(dirFd, filepath.Base(pRelPath)) - syscall.Close(dirFd) + plainTarget, err := syscallcompat.Readlinkat(dirfd, name) + syscall.Close(dirfd) if err != nil { return "", fuse.ToStatus(err) } |