summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/fusefrontend_reverse/rfile.go6
-rw-r--r--internal/fusefrontend_reverse/rfs.go10
-rwxr-xr-xtest.bash2
3 files changed, 14 insertions, 4 deletions
diff --git a/internal/fusefrontend_reverse/rfile.go b/internal/fusefrontend_reverse/rfile.go
index 4e9b5ba..8c5e5f3 100644
--- a/internal/fusefrontend_reverse/rfile.go
+++ b/internal/fusefrontend_reverse/rfile.go
@@ -34,10 +34,14 @@ func (rfs *reverseFS) NewFile(relPath string, flags uint32) (nodefs.File, fuse.S
return nil, fuse.ToStatus(err)
}
id := derivePathIV(relPath)
+ header := contentenc.FileHeader{
+ Version: contentenc.CurrentVersion,
+ Id: id,
+ }
return &reverseFile{
File: nodefs.NewDefaultFile(),
fd: fd,
- header: contentenc.FileHeader{contentenc.CurrentVersion, id},
+ header: header,
contentEnc: rfs.contentEnc,
}, fuse.OK
}
diff --git a/internal/fusefrontend_reverse/rfs.go b/internal/fusefrontend_reverse/rfs.go
index 06ca07e..8411461 100644
--- a/internal/fusefrontend_reverse/rfs.go
+++ b/internal/fusefrontend_reverse/rfs.go
@@ -246,7 +246,10 @@ func (rfs *reverseFS) OpenDir(cipherPath string, context *fuse.Context) ([]fuse.
// plus one for gocryptfs.diriv.
virtualFiles := make([]fuse.DirEntry, len(entries)+1)
// Virtual gocryptfs.diriv file
- virtualFiles[0] = fuse.DirEntry{syscall.S_IFREG | 0400, nametransform.DirIVFilename}
+ virtualFiles[0] = fuse.DirEntry{
+ Mode: syscall.S_IFREG | 0400,
+ Name: nametransform.DirIVFilename,
+ }
// Actually used entries
nVirtual := 1
@@ -261,7 +264,10 @@ func (rfs *reverseFS) OpenDir(cipherPath string, context *fuse.Context) ([]fuse.
cName = rfs.nameTransform.EncryptName(entries[i].Name, dirIV)
if len(cName) > syscall.NAME_MAX {
cName = nametransform.HashLongName(cName)
- dotNameFile := fuse.DirEntry{syscall.S_IFREG | 0600, cName + nametransform.LongNameSuffix}
+ dotNameFile := fuse.DirEntry{
+ Mode: syscall.S_IFREG | 0600,
+ Name: cName + nametransform.LongNameSuffix,
+ }
virtualFiles[nVirtual] = dotNameFile
nVirtual++
}
diff --git a/test.bash b/test.bash
index 8711d8f..eb9c5c6 100755
--- a/test.bash
+++ b/test.bash
@@ -13,4 +13,4 @@ go test ./... $*
# The tests cannot to this themselves as they are run in parallel
rm -Rf --one-file-system /tmp/gocryptfs-test-parent
-go tool vet -shadow=true .
+go tool vet -all -shadow .