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:
parent
8c5069c637
commit
3f68b0c09a
@ -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)
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user