aboutsummaryrefslogtreecommitdiff
path: root/pathfs_frontend/fs.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-09-09 19:32:59 +0200
committerJakob Unterwurzacher2015-09-09 19:32:59 +0200
commite7ba3c61f1055d740539d608cc521d816d07cddd (patch)
tree576c202f47457e2e2faad3f139efc65667cdc11e /pathfs_frontend/fs.go
parent80935a0e1b3848608bcc8e1e1497435801ac9940 (diff)
Fix File.GettAttr() size reporting
The too-large reported value broke mmap (applications saw appended zero bytes) Also * Add locking for all fd operations * Add "--debug" command line switch
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) {