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
This commit is contained in:
Sebastian Lackner 2017-11-28 00:20:42 +01:00 committed by rfjakob
parent 8c5069c637
commit 3f68b0c09a
2 changed files with 7 additions and 2 deletions

View File

@ -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)

View File

@ -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)
}
}