From a24342f656f6acd544ec07dada576d57a716b34d Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Tue, 12 Dec 2017 14:38:00 +0100 Subject: fusefrontend: Handle PlaintextNames mode in Link In PlaintextNames mode the "gocryptfs.longname." prefix does not have any special meaning. https://github.com/rfjakob/gocryptfs/issues/174 --- tests/matrix/matrix_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests') diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go index 4194861..90cf55e 100644 --- a/tests/matrix/matrix_test.go +++ b/tests/matrix/matrix_test.go @@ -812,3 +812,26 @@ func TestSymlink(t *testing.T) { t.Fatal(err) } } + +// Make sure the Link call works with paths starting with "gocryptfs.longname." +func TestLink(t *testing.T) { + target := test_helpers.DefaultPlainDir + "/linktarget" + f, err := os.Create(target) + if err != nil { + t.Fatal(err) + } + f.Close() + path := test_helpers.DefaultPlainDir + "/gocryptfs.longname.XXX" + err = syscall.Link(target, path) + if err != nil { + t.Fatal(err) + } + err = os.Remove(target) + if err != nil { + t.Fatal(err) + } + err = os.Remove(path) + if err != nil { + t.Fatal(err) + } +} -- cgit v1.2.3