summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/xattr_unit_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-10-14 20:11:49 +0200
committerJakob Unterwurzacher2019-01-01 16:24:09 +0100
commit932efbd4593fe6be6c86f0dafeaea32910b7c246 (patch)
treea950de9c1434a180f9b6f908d522d8222cecb768 /internal/fusefrontend/xattr_unit_test.go
parent0e2e7c13cfc6d37f2521db99bf0393c37a5549d6 (diff)
fusefrontend: make openBackingDir() symlink-safe
openBackingDir() used encryptPath(), which is not symlink-safe itself. Drop encryptPath() and implement our own directory walk. Adds three seconds to untar and two seconds to rm: $ ./benchmark.bash Testing gocryptfs at /tmp/benchmark.bash.MzG: gocryptfs v1.6-36-g8fb3c2f-dirty; go-fuse v20170619-66-g6df8ddc; 2018-10-14 go1.11 WRITE: 262144000 bytes (262 MB, 250 MiB) copied, 1.25078 s, 210 MB/s READ: 262144000 bytes (262 MB, 250 MiB) copied, 1.0318 s, 254 MB/s UNTAR: 20.941 MD5: 11.568 LS: 1.638 RM: 5.337
Diffstat (limited to 'internal/fusefrontend/xattr_unit_test.go')
-rw-r--r--internal/fusefrontend/xattr_unit_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/fusefrontend/xattr_unit_test.go b/internal/fusefrontend/xattr_unit_test.go
index c5c9360..b43aeb7 100644
--- a/internal/fusefrontend/xattr_unit_test.go
+++ b/internal/fusefrontend/xattr_unit_test.go
@@ -11,18 +11,17 @@ import (
"github.com/rfjakob/gocryptfs/internal/nametransform"
)
-func newTestFS() *FS {
+func newTestFS(args Args) *FS {
// Init crypto backend
key := make([]byte, cryptocore.KeyLen)
cCore := cryptocore.New(key, cryptocore.BackendGoGCM, contentenc.DefaultIVBits, true, false)
cEnc := contentenc.New(cCore, contentenc.DefaultBS, false)
nameTransform := nametransform.New(cCore.EMECipher, true, true)
- args := Args{}
return NewFS(args, cEnc, nameTransform)
}
func TestEncryptDecryptXattrName(t *testing.T) {
- fs := newTestFS()
+ fs := newTestFS(Args{})
attr1 := "user.foo123456789"
cAttr := fs.encryptXattrName(attr1)
t.Logf("cAttr=%v", cAttr)