diff options
author | Jakob Unterwurzacher | 2017-05-07 21:01:39 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2017-05-07 21:01:39 +0200 |
commit | ad7942f434fea567f24458e67a0919291b5ec8dd (patch) | |
tree | 463dac4ecb99970973ae662bdd50d05c1b71ced2 /tests/defaults/main_test.go | |
parent | 26881538e1753e613b4143b28fa339812a9a6d16 (diff) |
fusefrontend: implement path decryption via ctlsock
Closes https://github.com/rfjakob/gocryptfs/issues/84 .
Diffstat (limited to 'tests/defaults/main_test.go')
-rw-r--r-- | tests/defaults/main_test.go | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/tests/defaults/main_test.go b/tests/defaults/main_test.go index 2ea9e12..ca11b43 100644 --- a/tests/defaults/main_test.go +++ b/tests/defaults/main_test.go @@ -8,10 +8,8 @@ import ( "os/exec" "runtime" "sync" - "syscall" "testing" - "github.com/rfjakob/gocryptfs/internal/ctlsock" "github.com/rfjakob/gocryptfs/tests/test_helpers" ) @@ -42,36 +40,6 @@ func Test1980Tar(t *testing.T) { } } -func TestCtlSock(t *testing.T) { - cDir := test_helpers.InitFS(t) - pDir := cDir + ".mnt" - sock := cDir + ".sock" - test_helpers.MountOrFatal(t, cDir, pDir, "-ctlsock="+sock, "-extpass", "echo test") - defer test_helpers.UnmountPanic(pDir) - req := ctlsock.RequestStruct{ - EncryptPath: "foobar", - } - response := test_helpers.QueryCtlSock(t, sock, req) - if response.Result == "" || response.ErrNo != 0 { - t.Errorf("got an error reply: %+v", response) - } - req.EncryptPath = "not-existing-dir/xyz" - response = test_helpers.QueryCtlSock(t, sock, req) - if response.ErrNo != int32(syscall.ENOENT) || response.Result != "" { - t.Errorf("incorrect error handling: %+v", response) - } - // Strange paths should not cause a crash - crashers := []string{"/foo", "foo/", "/foo/", ".", "/////", "/../../."} - for _, c := range crashers { - req.EncryptPath = c - // QueryCtlSock calls t.Fatal if it gets EOF when gocryptfs panics - response = test_helpers.QueryCtlSock(t, sock, req) - if response.WarnText == "" { - t.Errorf("We should get a warning about non-canonical paths here") - } - } -} - // In gocryptfs before v1.2, the file header was only read once for each // open. But truncating a file to zero will generate a new random file ID. // The sequence below caused an I/O error to be returned. |