aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-03-05 22:59:25 +0100
committerJakob Unterwurzacher2017-03-05 22:59:25 +0100
commit445b5019e3f5a74409ca66c166cc1c3ccdd3dce7 (patch)
tree7cae90c96d8113dee657e50aa1f514138b99fa14 /internal/fusefrontend
parent5b54577d2ec553055c06e05841f626c10368c6b6 (diff)
nametransform: fix Raw64 not affecting symlink targets
The symlink functions incorrectly hardcoded the padded base64 variant.
Diffstat (limited to 'internal/fusefrontend')
-rw-r--r--internal/fusefrontend/fs.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go
index 020032b..9ffcff1 100644
--- a/internal/fusefrontend/fs.go
+++ b/internal/fusefrontend/fs.go
@@ -4,7 +4,6 @@ package fusefrontend
// FUSE operations on paths
import (
- "encoding/base64"
"os"
"path/filepath"
"sync"
@@ -298,7 +297,7 @@ func (fs *FS) Readlink(path string, context *fuse.Context) (out string, status f
return cTarget, fuse.OK
}
// Symlinks are encrypted like file contents (GCM) and base64-encoded
- cBinTarget, err := base64.URLEncoding.DecodeString(cTarget)
+ cBinTarget, err := fs.nameTransform.B64.DecodeString(cTarget)
if err != nil {
tlog.Warn.Printf("Readlink: %v", err)
return "", fuse.EIO
@@ -362,7 +361,7 @@ func (fs *FS) Symlink(target string, linkName string, context *fuse.Context) (co
}
// Symlinks are encrypted like file contents (GCM) and base64-encoded
cBinTarget := fs.contentEnc.EncryptBlock([]byte(target), 0, nil)
- cTarget := base64.URLEncoding.EncodeToString(cBinTarget)
+ cTarget := fs.nameTransform.B64.EncodeToString(cBinTarget)
// Handle long file name
cName := filepath.Base(cPath)
if nametransform.IsLongContent(cName) {