aboutsummaryrefslogtreecommitdiff
path: root/pathfs_frontend/fs.go
diff options
context:
space:
mode:
Diffstat (limited to 'pathfs_frontend/fs.go')
-rw-r--r--pathfs_frontend/fs.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/pathfs_frontend/fs.go b/pathfs_frontend/fs.go
index 0c1d879..1e4a1f3 100644
--- a/pathfs_frontend/fs.go
+++ b/pathfs_frontend/fs.go
@@ -112,8 +112,17 @@ func (fs *FS) Utimens(path string, Atime *time.Time, Mtime *time.Time, context *
return fs.FileSystem.Utimens(fs.EncryptPath(path), Atime, Mtime, context)
}
-func (fs *FS) Readlink(name string, context *fuse.Context) (out string, code fuse.Status) {
- return fs.FileSystem.Readlink(fs.EncryptPath(name), context)
+func (fs *FS) Readlink(name string, context *fuse.Context) (out string, status fuse.Status) {
+ dst, status := fs.FileSystem.Readlink(fs.EncryptPath(name), context)
+ if status != fuse.OK {
+ return "", status
+ }
+ dstPlain, err := fs.DecryptPath(dst)
+ if err != nil {
+ cryptfs.Warn.Printf("Failed decrypting symlink: %s\n", err.Error())
+ return "", fuse.EIO
+ }
+ return dstPlain, status
}
func (fs *FS) Mknod(name string, mode uint32, dev uint32, context *fuse.Context) (code fuse.Status) {