tests: enable all go vet checks
...and fix reported errors: internal/fusefrontend_reverse/rfile.go:40: github.com/rfjakob/gocryptfs/internal/contentenc.FileHeader composite literal uses unkeyed fields internal/fusefrontend_reverse/rfs.go:249: github.com/hanwen/go-fuse/fuse.DirEntry composite literal uses unkeyed fields internal/fusefrontend_reverse/rfs.go:264: github.com/hanwen/go-fuse/fuse.DirEntry composite literal uses unkeyed fields
This commit is contained in:
parent
c7b3150afc
commit
166ba74a05
@ -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
|
||||
}
|
||||
|
@ -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++
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user