aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend/fs.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-04-02 18:32:30 +0200
committerJakob Unterwurzacher2018-04-02 18:32:30 +0200
commitb6c8960b01f9e5366814b0dada57a0b1e6a031d9 (patch)
tree6a65255c30c7bcd086523fd4e0970d3b59b230de /internal/fusefrontend/fs.go
parente6caf56ea4ab10e747aa5dfc0a768cb8176ebe6a (diff)
fsck: clean up log output
Make sure we get only 1 warning output per problem. Also, add new corruption types to broken_fs_v1.4.
Diffstat (limited to 'internal/fusefrontend/fs.go')
-rw-r--r--internal/fusefrontend/fs.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go
index e246264..5f84541 100644
--- a/internal/fusefrontend/fs.go
+++ b/internal/fusefrontend/fs.go
@@ -365,12 +365,13 @@ func (fs *FS) decryptSymlinkTarget(cData64 string) (string, error) {
}
// Readlink implements pathfs.Filesystem.
-func (fs *FS) Readlink(path string, context *fuse.Context) (out string, status fuse.Status) {
- cPath, err := fs.getBackingPath(path)
+func (fs *FS) Readlink(relPath string, context *fuse.Context) (out string, status fuse.Status) {
+ cPath, err := fs.encryptPath(relPath)
if err != nil {
return "", fuse.ToStatus(err)
}
- cTarget, err := os.Readlink(cPath)
+ cAbsPath := filepath.Join(fs.args.Cipherdir, cPath)
+ cTarget, err := os.Readlink(cAbsPath)
if err != nil {
return "", fuse.ToStatus(err)
}
@@ -380,7 +381,7 @@ func (fs *FS) Readlink(path string, context *fuse.Context) (out string, status f
// Symlinks are encrypted like file contents (GCM) and base64-encoded
target, err := fs.decryptSymlinkTarget(cTarget)
if err != nil {
- tlog.Warn.Printf("Readlink: %v", err)
+ tlog.Warn.Printf("Readlink %q: decrypting target failed: %v", cPath, err)
return "", fuse.EIO
}
return string(target), fuse.OK