aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fusefrontend_reverse')
-rw-r--r--internal/fusefrontend_reverse/excluder_test.go9
-rw-r--r--internal/fusefrontend_reverse/mocks_test.go32
-rw-r--r--internal/fusefrontend_reverse/root_node.go4
3 files changed, 2 insertions, 43 deletions
diff --git a/internal/fusefrontend_reverse/excluder_test.go b/internal/fusefrontend_reverse/excluder_test.go
index d6cfef3..e44c0e0 100644
--- a/internal/fusefrontend_reverse/excluder_test.go
+++ b/internal/fusefrontend_reverse/excluder_test.go
@@ -64,12 +64,3 @@ func TestShouldReturnFalseIfThereAreNoExclusions(t *testing.T) {
t.Error("Should not exclude any path if no exclusions were specified")
}
}
-
-func TestShouldCallIgnoreParserToCheckExclusion(t *testing.T) {
- rfs, ignorerMock := createRFSWithMocks()
-
- rfs.isExcludedPlain("some/path")
- if ignorerMock.calledWith != "some/path" {
- t.Error("Failed to call IgnoreParser")
- }
-}
diff --git a/internal/fusefrontend_reverse/mocks_test.go b/internal/fusefrontend_reverse/mocks_test.go
deleted file mode 100644
index 2d14c1d..0000000
--- a/internal/fusefrontend_reverse/mocks_test.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package fusefrontend_reverse
-
-import (
- "github.com/rfjakob/gocryptfs/internal/nametransform"
-)
-
-type IgnoreParserMock struct {
- toExclude string
- calledWith string
-}
-
-func (parser *IgnoreParserMock) MatchesPath(f string) bool {
- parser.calledWith = f
- return f == parser.toExclude
-}
-
-type NameTransformMock struct {
- nametransform.NameTransform
-}
-
-func (n *NameTransformMock) DecryptName(cipherName string, iv []byte) (string, error) {
- return "mockdecrypt_" + cipherName, nil
-}
-
-func createRFSWithMocks() (*RootNode, *IgnoreParserMock) {
- ignorerMock := &IgnoreParserMock{}
- nameTransformMock := &NameTransformMock{}
- var rfs RootNode
- rfs.excluder = ignorerMock
- rfs.nameTransform = nameTransformMock
- return &rfs, ignorerMock
-}
diff --git a/internal/fusefrontend_reverse/root_node.go b/internal/fusefrontend_reverse/root_node.go
index 10b0d69..b072f85 100644
--- a/internal/fusefrontend_reverse/root_node.go
+++ b/internal/fusefrontend_reverse/root_node.go
@@ -28,7 +28,7 @@ type RootNode struct {
// Stores configuration arguments
args fusefrontend.Args
// Filename encryption helper
- nameTransform nametransform.NameTransformer
+ nameTransform *nametransform.NameTransform
// Content encryption helper
contentEnc *contentenc.ContentEnc
// Tests whether a path is excluded (hidden) from the user. Used by -exclude.
@@ -41,7 +41,7 @@ type RootNode struct {
// NewRootNode returns an encrypted FUSE overlay filesystem.
// In this case (reverse mode) the backing directory is plain-text and
// ReverseFS provides an encrypted view.
-func NewRootNode(args fusefrontend.Args, c *contentenc.ContentEnc, n nametransform.NameTransformer) *RootNode {
+func NewRootNode(args fusefrontend.Args, c *contentenc.ContentEnc, n *nametransform.NameTransform) *RootNode {
rn := &RootNode{
args: args,
nameTransform: n,