Skip to content

Commit

Permalink
fusefrontend: Handle PlaintextNames mode in Mknod
Browse files Browse the repository at this point in the history
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 rfjakob#174
  • Loading branch information
slackner committed Nov 28, 2017
1 parent a0e5318 commit 84fb791
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/fusefrontend/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions tests/matrix/matrix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 84fb791

Please sign in to comment.