aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/fusefrontend/fs.go2
-rw-r--r--tests/matrix/matrix_test.go17
2 files changed, 18 insertions, 1 deletions
diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go
index a77eae0..46787e2 100644
--- a/internal/fusefrontend/fs.go
+++ b/internal/fusefrontend/fs.go
@@ -388,7 +388,7 @@ func (fs *FS) Unlink(path string, context *fuse.Context) (code fuse.Status) {
}
cName := filepath.Base(cPath)
- if nametransform.IsLongContent(cName) {
+ if !fs.args.PlaintextNames && nametransform.IsLongContent(cName) {
var dirfd *os.File
dirfd, err = os.Open(filepath.Dir(cPath))
if err != nil {
diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go
index 06c2e71..4194861 100644
--- a/tests/matrix/matrix_test.go
+++ b/tests/matrix/matrix_test.go
@@ -794,4 +794,21 @@ func TestMkfifo(t *testing.T) {
if err != nil {
t.Fatal(err)
}
+ err = os.Remove(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+}
+
+// Make sure the Symlink call works with paths starting with "gocryptfs.longname."
+func TestSymlink(t *testing.T) {
+ path := test_helpers.DefaultPlainDir + "/gocryptfs.longname.XXX"
+ err := syscall.Symlink("target", path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ err = os.Remove(path)
+ if err != nil {
+ t.Fatal(err)
+ }
}