aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Lackner2017-11-28 00:20:42 +0100
committerrfjakob2017-11-28 09:28:06 +0100
commit3f68b0c09af2b3070346e27b384e80116e515f73 (patch)
tree2ea9b1491a7caa047572bfd184afe7528cf56433
parent8c5069c6374778bab17cd640b2579c936c635fa7 (diff)
fusefrontend: Handle PlaintextNames mode in Mknod
In PlaintextNames mode the "gocryptfs.longname." prefix does not have any special meaning. We should not attempt to read the directory IV or to create special .name files. Partially fixes https://github.com/rfjakob/gocryptfs/issues/174
-rw-r--r--internal/fusefrontend/fs.go4
-rw-r--r--tests/matrix/matrix_test.go5
2 files changed, 7 insertions, 2 deletions
diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go
index 8f77538..05167df 100644
--- a/internal/fusefrontend/fs.go
+++ b/internal/fusefrontend/fs.go
@@ -287,9 +287,9 @@ func (fs *FS) Mknod(path string, mode uint32, dev uint32, context *fuse.Context)
return fuse.ToStatus(err)
}
defer dirfd.Close()
- // Create ".name" file to store long file name
+ // Create ".name" file to store long file name (except in PlaintextNames mode)
cName := filepath.Base(cPath)
- if nametransform.IsLongContent(cName) {
+ if !fs.args.PlaintextNames && nametransform.IsLongContent(cName) {
err = fs.nameTransform.WriteLongName(dirfd, cName, path)
if err != nil {
return fuse.ToStatus(err)
diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go
index 170f8ba..06c2e71 100644
--- a/tests/matrix/matrix_test.go
+++ b/tests/matrix/matrix_test.go
@@ -789,4 +789,9 @@ func TestMkfifo(t *testing.T) {
if err != nil {
t.Fatal(err)
}
+ path = test_helpers.DefaultPlainDir + "/gocryptfs.longname.XXX"
+ err = syscall.Mkfifo(path, 0700)
+ if err != nil {
+ t.Fatal(err)
+ }
}