Browse Source

go mod: declare module version v2

Our git version is v2+ for some time now, but go.mod
still declared v1. Hopefully making both match makes
https://pkg.go.dev/github.com/rfjakob/gocryptfs/v2 work.

All the import paths have been fixed like this:

  find . -name \*.go | xargs sed -i s%github.com/rfjakob/gocryptfs/%github.com/rfjakob/gocryptfs/v2/%
master
Jakob Unterwurzacher 12 months ago
parent
commit
69d88505fd
  1. 10
      cli_args.go
  2. 2
      cli_args_test.go
  3. 2
      contrib/findholes/main.go
  4. 2
      contrib/getdents-debug/getdents/getdents.go
  5. 2
      contrib/getdents-debug/readdirnames/readdirnames.go
  6. 6
      daemonize.go
  7. 8
      fsck.go
  8. 2
      go.mod
  9. 2
      gocryptfs-xray/paths_ctlsock.go
  10. 14
      gocryptfs-xray/xray_main.go
  11. 2
      gocryptfs-xray/xray_tests/xray_test.go
  12. 2
      help.go
  13. 8
      info.go
  14. 16
      init_dir.go
  15. 14
      internal/configfile/config_file.go
  16. 2
      internal/configfile/config_test.go
  17. 6
      internal/configfile/scrypt.go
  18. 2
      internal/configfile/scrypt_test.go
  19. 8
      internal/contentenc/content.go
  20. 2
      internal/contentenc/content_test.go
  21. 2
      internal/contentenc/file_header.go
  22. 2
      internal/contentenc/offsets.go
  23. 2
      internal/contentenc/offsets_test.go
  24. 6
      internal/cryptocore/cryptocore.go
  25. 2
      internal/cryptocore/cryptocore_test.go
  26. 4
      internal/ctlsocksrv/ctlsock_serve.go
  27. 6
      internal/ensurefds012/ensurefds012.go
  28. 6
      internal/fido2/fido2.go
  29. 2
      internal/fusefrontend/args.go
  30. 8
      internal/fusefrontend/ctlsock_interface.go
  31. 2
      internal/fusefrontend/dircache.go
  32. 14
      internal/fusefrontend/file.go
  33. 4
      internal/fusefrontend/file_allocate_truncate.go
  34. 2
      internal/fusefrontend/file_holes.go
  35. 4
      internal/fusefrontend/file_setattr.go
  36. 6
      internal/fusefrontend/node.go
  37. 10
      internal/fusefrontend/node_dir_ops.go
  38. 4
      internal/fusefrontend/node_helpers.go
  39. 6
      internal/fusefrontend/node_open_create.go
  40. 4
      internal/fusefrontend/node_prepare_syscall.go
  41. 6
      internal/fusefrontend/node_xattr.go
  42. 2
      internal/fusefrontend/node_xattr_darwin.go
  43. 2
      internal/fusefrontend/node_xattr_linux.go
  44. 4
      internal/fusefrontend/prepare_syscall_test.go
  45. 14
      internal/fusefrontend/root_node.go
  46. 6
      internal/fusefrontend/xattr_unit_test.go
  47. 2
      internal/fusefrontend_reverse/ctlsock_interface.go
  48. 6
      internal/fusefrontend_reverse/excluder.go
  49. 2
      internal/fusefrontend_reverse/excluder_test.go
  50. 2
      internal/fusefrontend_reverse/file.go
  51. 6
      internal/fusefrontend_reverse/file_helpers.go
  52. 8
      internal/fusefrontend_reverse/node.go
  53. 10
      internal/fusefrontend_reverse/node_dir_ops.go
  54. 6
      internal/fusefrontend_reverse/node_helpers.go
  55. 12
      internal/fusefrontend_reverse/root_node.go
  56. 8
      internal/fusefrontend_reverse/rpath.go
  57. 6
      internal/fusefrontend_reverse/virtualnode.go
  58. 2
      internal/inomap/inomap.go
  59. 2
      internal/nametransform/badname.go
  60. 8
      internal/nametransform/diriv.go
  61. 4
      internal/nametransform/longnames.go
  62. 2
      internal/nametransform/names.go
  63. 4
      internal/nametransform/perms.go
  64. 2
      internal/openfiletable/open_file_table.go
  65. 2
      internal/pathiv/pathiv.go
  66. 2
      internal/readpassword/extpass_test.go
  67. 4
      internal/readpassword/passfile.go
  68. 4
      internal/readpassword/read.go
  69. 2
      internal/serialize_reads/sr.go
  70. 4
      internal/speed/speed.go
  71. 2
      internal/speed/speed_test.go
  72. 4
      internal/stupidgcm/prefer.go
  73. 2
      internal/stupidgcm/without_openssl.go
  74. 2
      internal/syscallcompat/eintr.go
  75. 8
      internal/syscallcompat/getdents_linux.go
  76. 2
      internal/syscallcompat/getdents_test.go
  77. 2
      internal/syscallcompat/open_nofollow.go
  78. 8
      internal/syscallcompat/quirks.go
  79. 8
      internal/syscallcompat/quirks_darwin.go
  80. 8
      internal/syscallcompat/quirks_linux.go
  81. 2
      internal/syscallcompat/sys_common.go
  82. 2
      internal/syscallcompat/sys_darwin.go
  83. 4
      internal/syscallcompat/sys_linux.go
  84. 18
      main.go
  85. 8
      masterkey.go
  86. 22
      mount.go
  87. 4
      profiling.go
  88. 2
      sendusr1.go
  89. 24
      tests/cli/cli_test.go
  90. 2
      tests/cli/zerokey.go
  91. 6
      tests/defaults/acl_test.go
  92. 4
      tests/defaults/ctlsock_test.go
  93. 2
      tests/defaults/diriv_test.go
  94. 4
      tests/defaults/main_test.go
  95. 2
      tests/defaults/performance_test.go
  96. 4
      tests/deterministic_names/deterministic_names_test.go
  97. 4
      tests/example_filesystems/example_filesystems_test.go
  98. 2
      tests/example_filesystems/example_test_helpers.go
  99. 4
      tests/fsck/fsck_test.go
  100. 2
      tests/hkdf_sanity/sanity_test.go
  101. Some files were not shown because too many files have changed in this diff Show More

10
cli_args.go

@ -4,7 +4,7 @@ import (
// Should be initialized before anything else.
// This import line MUST be in the alphabetically first source code file of
// package main!
_ "github.com/rfjakob/gocryptfs/internal/ensurefds012"
_ "github.com/rfjakob/gocryptfs/v2/internal/ensurefds012"
"fmt"
"net"
@ -18,10 +18,10 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/configfile"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/configfile"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// argContainer stores the parsed CLI options and arguments

2
cli_args_test.go

@ -4,7 +4,7 @@ import (
"reflect"
"testing"
"github.com/rfjakob/gocryptfs/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/v2/internal/stupidgcm"
)
// TestPrefixOArgs checks that the "-o x,y,z" parsing works correctly.

2
contrib/findholes/main.go

@ -6,7 +6,7 @@ import (
"fmt"
"os"
"github.com/rfjakob/gocryptfs/contrib/findholes/holes"
"github.com/rfjakob/gocryptfs/v2/contrib/findholes/holes"
)
func main() {

2
contrib/getdents-debug/getdents/getdents.go

@ -1,6 +1,6 @@
/*
Small tool to try to debug unix.Getdents problems on CIFS mounts
( https://github.com/rfjakob/gocryptfs/issues/483 )
( https://github.com/rfjakob/gocryptfs/v2/issues/483 )
Example output:

2
contrib/getdents-debug/readdirnames/readdirnames.go

@ -1,6 +1,6 @@
/*
Small tool to try to debug unix.Getdents problems on CIFS mounts
( https://github.com/rfjakob/gocryptfs/issues/483 )
( https://github.com/rfjakob/gocryptfs/v2/issues/483 )
Example output:

6
daemonize.go

@ -7,9 +7,9 @@ import (
"os/signal"
"syscall"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// The child sends us USR1 if the mount was successful. Exit with error code

8
fsck.go

@ -14,10 +14,10 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/internal/fusefrontend"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/fusefrontend"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
type fsckObj struct {

2
go.mod

@ -1,4 +1,4 @@
module github.com/rfjakob/gocryptfs
module github.com/rfjakob/gocryptfs/v2
go 1.16

2
gocryptfs-xray/paths_ctlsock.go

@ -5,7 +5,7 @@ import (
"fmt"
"os"
"github.com/rfjakob/gocryptfs/ctlsock"
"github.com/rfjakob/gocryptfs/v2/ctlsock"
)
func decryptPaths(socketPath string, sep0 bool) {

14
gocryptfs-xray/xray_main.go

@ -8,13 +8,13 @@ import (
"os"
"runtime"
"github.com/rfjakob/gocryptfs/internal/configfile"
"github.com/rfjakob/gocryptfs/internal/contentenc"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/internal/fido2"
"github.com/rfjakob/gocryptfs/internal/readpassword"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/configfile"
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
"github.com/rfjakob/gocryptfs/v2/internal/cryptocore"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/fido2"
"github.com/rfjakob/gocryptfs/v2/internal/readpassword"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// GitVersion is the gocryptfs version according to git, set by build.bash

2
gocryptfs-xray/xray_tests/xray_test.go

@ -7,7 +7,7 @@ import (
"os/exec"
"testing"
"github.com/rfjakob/gocryptfs/tests/test_helpers"
"github.com/rfjakob/gocryptfs/v2/tests/test_helpers"
)
func TestAesgcmXray(t *testing.T) {

2
help.go

@ -3,7 +3,7 @@ package main
import (
"fmt"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
const tUsage = "" +

8
info.go

@ -7,10 +7,10 @@ import (
"os"
"strings"
"github.com/rfjakob/gocryptfs/internal/configfile"
"github.com/rfjakob/gocryptfs/internal/contentenc"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/configfile"
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// info pretty-prints the contents of the config file at "filename" for human

16
init_dir.go

@ -8,14 +8,14 @@ import (
"strings"
"syscall"
"github.com/rfjakob/gocryptfs/internal/configfile"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/internal/fido2"
"github.com/rfjakob/gocryptfs/internal/nametransform"
"github.com/rfjakob/gocryptfs/internal/readpassword"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/configfile"
"github.com/rfjakob/gocryptfs/v2/internal/cryptocore"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/fido2"
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
"github.com/rfjakob/gocryptfs/v2/internal/readpassword"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// isEmptyDir checks if "dir" exists and is an empty directory.

14
internal/configfile/config_file.go

@ -12,10 +12,10 @@ import (
"os"
"github.com/rfjakob/gocryptfs/internal/contentenc"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
"github.com/rfjakob/gocryptfs/v2/internal/cryptocore"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
const (
@ -223,10 +223,10 @@ func Load(filename string) (*ConfFile, error) {
The filesystem was created by gocryptfs v0.6 or earlier. This version of
gocryptfs can no longer mount the filesystem.
Please download gocryptfs v0.11 and upgrade your filesystem,
see https://github.com/rfjakob/gocryptfs/wiki/Upgrading for instructions.
see https://github.com/rfjakob/gocryptfs/v2/wiki/Upgrading for instructions.
If you have trouble upgrading, join the discussion at
https://github.com/rfjakob/gocryptfs/issues/29 .
https://github.com/rfjakob/gocryptfs/v2/issues/29 .
`+tlog.ColorReset)
@ -312,7 +312,7 @@ func (cf *ConfFile) WriteFile() error {
err = fd.Sync()
if err != nil {
// This can happen on network drives: FRITZ.NAS mounted on MacOS returns
// "operation not supported": https://github.com/rfjakob/gocryptfs/issues/390
// "operation not supported": https://github.com/rfjakob/gocryptfs/v2/issues/390
tlog.Warn.Printf("Warning: fsync failed: %v", err)
// Try sync instead
syscall.Sync()

2
internal/configfile/config_test.go

@ -5,7 +5,7 @@ import (
"testing"
"time"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
var testPw = []byte("test")

6
internal/configfile/scrypt.go

@ -7,9 +7,9 @@ import (
"golang.org/x/crypto/scrypt"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/cryptocore"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
const (

2
internal/configfile/scrypt_test.go

@ -17,7 +17,7 @@ BenchmarkScrypt14-2 20 92561590 ns/op ... 92ms
BenchmarkScrypt15-2 10 183971593 ns/op
BenchmarkScrypt16-2 3 368506365 ns/op
BenchmarkScrypt17-2 2 755502608 ns/op ... 755ms
ok github.com/rfjakob/gocryptfs/cryptfs 18.772s
ok github.com/rfjakob/gocryptfs/v2/cryptfs 18.772s
*/
func benchmarkScryptN(n int, b *testing.B) {

8
internal/contentenc/content.go

@ -12,9 +12,9 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/cryptocore"
"github.com/rfjakob/gocryptfs/v2/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// NonceMode determines how nonces are created.
@ -179,7 +179,7 @@ func (be *ContentEnc) DecryptBlock(ciphertext []byte, blockNo uint64, fileID []b
nonce := ciphertext[:be.cryptoCore.IVLen]
if bytes.Equal(nonce, be.allZeroNonce) {
// Bug in tmpfs?
// https://github.com/rfjakob/gocryptfs/issues/56
// https://github.com/rfjakob/gocryptfs/v2/issues/56
// http://www.spinics.net/lists/kernel/msg2370127.html
return nil, errors.New("all-zero nonce")
}

2
internal/contentenc/content_test.go

@ -3,7 +3,7 @@ package contentenc
import (
"testing"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/v2/internal/cryptocore"
)
type testRange struct {

2
internal/contentenc/file_header.go

@ -11,7 +11,7 @@ import (
"fmt"
"log"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/v2/internal/cryptocore"
)
const (

2
internal/contentenc/offsets.go

@ -3,7 +3,7 @@ package contentenc
import (
"log"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// Contentenc methods that translate offsets between ciphertext and plaintext

2
internal/contentenc/offsets_test.go

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/v2/internal/cryptocore"
)
// TestSizeToSize tests CipherSizeToPlainSize and PlainSizeToCipherSize

6
internal/cryptocore/cryptocore.go

@ -12,9 +12,9 @@ import (
"github.com/rfjakob/eme"
"github.com/rfjakob/gocryptfs/internal/siv_aead"
"github.com/rfjakob/gocryptfs/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/siv_aead"
"github.com/rfjakob/gocryptfs/v2/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
const (

2
internal/cryptocore/cryptocore_test.go

@ -3,7 +3,7 @@ package cryptocore
import (
"testing"
"github.com/rfjakob/gocryptfs/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/v2/internal/stupidgcm"
)
// "New" should accept at least these param combinations

4
internal/ctlsocksrv/ctlsock_serve.go

@ -11,8 +11,8 @@ import (
"os"
"syscall"
"github.com/rfjakob/gocryptfs/ctlsock"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/ctlsock"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// Interface should be implemented by fusefrontend[_reverse]

6
internal/ensurefds012/ensurefds012.go

@ -5,7 +5,7 @@
//
// Use like this:
//
// import _ "github.com/rfjakob/gocryptfs/internal/ensurefds012"
// import _ "github.com/rfjakob/gocryptfs/v2/internal/ensurefds012"
//
// The import line MUST be in the alphabitcally first source code file of
// package main!
@ -25,14 +25,14 @@
// l-wx------. 1 jakob jakob 64 Jan 5 15:54 3 -> /dev/null
// lrwx------. 1 jakob jakob 64 Jan 5 15:54 4 -> 'anon_inode:[eventpoll]'
//
// See https://github.com/rfjakob/gocryptfs/issues/320 for details.
// See https://github.com/rfjakob/gocryptfs/v2/issues/320 for details.
package ensurefds012
import (
"os"
"syscall"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
)
func init() {

6
internal/fido2/fido2.go

@ -9,9 +9,9 @@ import (
"os/exec"
"strings"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/cryptocore"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
type fidoCommand int

2
internal/fusefrontend/args.go

@ -42,7 +42,7 @@ type Args struct {
// Suid is true if the filesystem has been mounted with the "-suid" flag.
// If it is false, we can ignore the GETXATTR "security.capability" calls,
// which are a performance problem for writes. See
// https://github.com/rfjakob/gocryptfs/issues/515 for details.
// https://github.com/rfjakob/gocryptfs/v2/issues/515 for details.
Suid bool
// Enable the FUSE kernel_cache option
KernelCache bool

8
internal/fusefrontend/ctlsock_interface.go

@ -6,10 +6,10 @@ import (
"strings"
"syscall"
"github.com/rfjakob/gocryptfs/internal/ctlsocksrv"
"github.com/rfjakob/gocryptfs/internal/nametransform"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/ctlsocksrv"
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
var _ ctlsocksrv.Interface = &RootNode{} // Verify that interface is implemented.

2
internal/fusefrontend/dircache.go

@ -7,7 +7,7 @@ import (
"syscall"
"time"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
const (

14
internal/fusefrontend/file.go

@ -17,13 +17,13 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/contentenc"
"github.com/rfjakob/gocryptfs/internal/inomap"
"github.com/rfjakob/gocryptfs/internal/openfiletable"
"github.com/rfjakob/gocryptfs/internal/serialize_reads"
"github.com/rfjakob/gocryptfs/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
"github.com/rfjakob/gocryptfs/v2/internal/inomap"
"github.com/rfjakob/gocryptfs/v2/internal/openfiletable"
"github.com/rfjakob/gocryptfs/v2/internal/serialize_reads"
"github.com/rfjakob/gocryptfs/v2/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// File implements the go-fuse v2 API (github.com/hanwen/go-fuse/v2/fs)

4
internal/fusefrontend/file_allocate_truncate.go

@ -11,8 +11,8 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// FALLOC_DEFAULT is a "normal" fallocate operation

2
internal/fusefrontend/file_holes.go

@ -9,7 +9,7 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// Will a write to plaintext offset "targetOff" create a file hole in the

4
internal/fusefrontend/file_setattr.go

@ -7,8 +7,8 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
func (f *File) Setattr(ctx context.Context, in *fuse.SetAttrIn, out *fuse.AttrOut) (errno syscall.Errno) {

6
internal/fusefrontend/node.go

@ -9,9 +9,9 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/nametransform"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// Node is a file or directory in the filesystem tree

10
internal/fusefrontend/node_dir_ops.go

@ -12,11 +12,11 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/configfile"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/nametransform"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/configfile"
"github.com/rfjakob/gocryptfs/v2/internal/cryptocore"
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
const dsStoreName = ".DS_Store"

4
internal/fusefrontend/node_helpers.go

@ -9,8 +9,8 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// toFuseCtx tries to extract a fuse.Context from a generic context.Context.

6
internal/fusefrontend/node_open_create.go

@ -7,9 +7,9 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/nametransform"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// Open - FUSE call. Open already-existing file.

4
internal/fusefrontend/node_prepare_syscall.go

@ -4,11 +4,11 @@ import (
"sync/atomic"
"syscall"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
"github.com/hanwen/go-fuse/v2/fs"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
)
// prepareAtSyscall returns a (dirfd, cName) pair that can be used

6
internal/fusefrontend/node_xattr.go

@ -9,7 +9,7 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// -1 as uint32
@ -24,7 +24,7 @@ var xattrNameIV = []byte("xattr_name_iv_xx")
var xattrStorePrefix = "user.gocryptfs."
// We get one read of this xattr for each write -
// see https://github.com/rfjakob/gocryptfs/issues/515 for details.
// see https://github.com/rfjakob/gocryptfs/v2/issues/515 for details.
var xattrCapability = "security.capability"
// isAcl returns true if the attribute name is for storing ACLs
@ -41,7 +41,7 @@ func (n *Node) Getxattr(ctx context.Context, attr string, dest []byte) (uint32,
rn := n.rootNode()
// If we are not mounted with -suid, reading the capability xattr does not
// make a lot of sense, so reject the request and gain a massive speedup.
// See https://github.com/rfjakob/gocryptfs/issues/515 .
// See https://github.com/rfjakob/gocryptfs/v2/issues/515 .
if !rn.args.Suid && attr == xattrCapability {
// Returning EOPNOTSUPP is what we did till
// ca9e912a28b901387e1dbb85f6c531119f2d5ef2 "fusefrontend: drop xattr user namespace restriction"

2
internal/fusefrontend/node_xattr_darwin.go

@ -8,7 +8,7 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
)
// On Darwin we have to unset XATTR_NOSECURITY 0x0008

2
internal/fusefrontend/node_xattr_linux.go

@ -9,7 +9,7 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
)
func filterXattrSetFlags(flags int) int {

4
internal/fusefrontend/prepare_syscall_test.go

@ -9,8 +9,8 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/tests/test_helpers"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/tests/test_helpers"
)
func TestPrepareAtSyscall(t *testing.T) {

14
internal/fusefrontend/root_node.go

@ -7,13 +7,13 @@ import (
"syscall"
"time"
"github.com/rfjakob/gocryptfs/internal/configfile"
"github.com/rfjakob/gocryptfs/internal/contentenc"
"github.com/rfjakob/gocryptfs/internal/inomap"
"github.com/rfjakob/gocryptfs/internal/nametransform"
"github.com/rfjakob/gocryptfs/internal/serialize_reads"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/configfile"
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
"github.com/rfjakob/gocryptfs/v2/internal/inomap"
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
"github.com/rfjakob/gocryptfs/v2/internal/serialize_reads"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// RootNode is the root of the filesystem tree of Nodes.

6
internal/fusefrontend/xattr_unit_test.go

@ -9,9 +9,9 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/rfjakob/gocryptfs/internal/contentenc"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/nametransform"
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
"github.com/rfjakob/gocryptfs/v2/internal/cryptocore"
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
)
func newTestFS(args Args) *RootNode {

2
internal/fusefrontend_reverse/ctlsock_interface.go

@ -6,7 +6,7 @@ import (
"golang.org/x/sys/unix"
"github.com/rfjakob/gocryptfs/internal/ctlsocksrv"
"github.com/rfjakob/gocryptfs/v2/internal/ctlsocksrv"
)
// Verify that the interface is implemented.

6
internal/fusefrontend_reverse/excluder.go

@ -6,9 +6,9 @@ import (
"os"
"strings"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/internal/fusefrontend"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/fusefrontend"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
"github.com/sabhiram/go-gitignore"
)

2
internal/fusefrontend_reverse/excluder_test.go

@ -6,7 +6,7 @@ import (
"reflect"
"testing"
"github.com/rfjakob/gocryptfs/internal/fusefrontend"
"github.com/rfjakob/gocryptfs/v2/internal/fusefrontend"
)
func TestShouldPrefixExcludeValuesWithSlash(t *testing.T) {

2
internal/fusefrontend_reverse/file.go

@ -9,7 +9,7 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/contentenc"
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
)
type File struct {

6
internal/fusefrontend_reverse/file_helpers.go

@ -5,9 +5,9 @@ import (
"io"
"sync"
"github.com/rfjakob/gocryptfs/internal/contentenc"
"github.com/rfjakob/gocryptfs/internal/pathiv"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
"github.com/rfjakob/gocryptfs/v2/internal/pathiv"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
var inodeTable sync.Map

8
internal/fusefrontend_reverse/node.go

@ -12,10 +12,10 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/contentenc"
"github.com/rfjakob/gocryptfs/internal/pathiv"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
"github.com/rfjakob/gocryptfs/v2/internal/pathiv"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// Node is a file or directory in the filesystem tree

10
internal/fusefrontend_reverse/node_dir_ops.go

@ -10,11 +10,11 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/configfile"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/nametransform"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/configfile"
"github.com/rfjakob/gocryptfs/v2/internal/cryptocore"
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// Readdir - FUSE call.

6
internal/fusefrontend_reverse/node_helpers.go

@ -11,9 +11,9 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/configfile"
"github.com/rfjakob/gocryptfs/internal/pathiv"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/configfile"
"github.com/rfjakob/gocryptfs/v2/internal/pathiv"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
)
const (

12
internal/fusefrontend_reverse/root_node.go

@ -6,18 +6,18 @@ import (
"strings"
"syscall"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
"golang.org/x/sys/unix"
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/contentenc"
"github.com/rfjakob/gocryptfs/internal/fusefrontend"
"github.com/rfjakob/gocryptfs/internal/inomap"
"github.com/rfjakob/gocryptfs/internal/nametransform"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
"github.com/rfjakob/gocryptfs/v2/internal/fusefrontend"
"github.com/rfjakob/gocryptfs/v2/internal/inomap"
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/sabhiram/go-gitignore"
)

8
internal/fusefrontend_reverse/rpath.go

@ -7,10 +7,10 @@ import (
"strings"
"syscall"
"github.com/rfjakob/gocryptfs/internal/nametransform"
"github.com/rfjakob/gocryptfs/internal/pathiv"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
"github.com/rfjakob/gocryptfs/v2/internal/pathiv"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// rDecryptName decrypts the ciphertext name "cName", given the dirIV of the

6
internal/fusefrontend_reverse/virtualnode.go

@ -8,9 +8,9 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/configfile"
"github.com/rfjakob/gocryptfs/internal/inomap"
"github.com/rfjakob/gocryptfs/internal/nametransform"
"github.com/rfjakob/gocryptfs/v2/internal/configfile"
"github.com/rfjakob/gocryptfs/v2/internal/inomap"
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
)
const (

2
internal/inomap/inomap.go

@ -19,7 +19,7 @@ import (
"sync"
"syscall"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
const (

2
internal/nametransform/badname.go

@ -8,7 +8,7 @@ import (
"golang.org/x/sys/unix"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
)
const (

8
internal/nametransform/diriv.go

@ -7,9 +7,9 @@ import (
"os"
"syscall"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/cryptocore"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
const (
@ -68,7 +68,7 @@ func WriteDirIVAt(dirfd int) error {
iv := cryptocore.RandBytes(DirIVLen)
// 0400 permissions: gocryptfs.diriv should never be modified after creation.
// Don't use "ioutil.WriteFile", it causes trouble on NFS:
// https://github.com/rfjakob/gocryptfs/commit/7d38f80a78644c8ec4900cc990bfb894387112ed
// https://github.com/rfjakob/gocryptfs/v2/commit/7d38f80a78644c8ec4900cc990bfb894387112ed
fd, err := syscallcompat.Openat(dirfd, DirIVFilename, os.O_WRONLY|os.O_CREATE|os.O_EXCL, dirivPerms)
if err != nil {
tlog.Warn.Printf("WriteDirIV: Openat: %v", err)

4
internal/nametransform/longnames.go

@ -9,8 +9,8 @@ import (
"strings"
"syscall"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
const (

2
internal/nametransform/names.go

@ -9,7 +9,7 @@ import (
"github.com/rfjakob/eme"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
const (

4
internal/nametransform/perms.go

@ -6,14 +6,14 @@ const (
// never chmod'ed or chown'ed.
//
// Group-readable so the FS can be mounted by several users in the same group
// (see https://github.com/rfjakob/gocryptfs/issues/387 ).
// (see https://github.com/rfjakob/gocryptfs/v2/issues/387 ).
//
// Note that gocryptfs.conf is still created with 0400 permissions so the
// owner must explicitly chmod it to permit access.
//
// World-readable so an encrypted directory can be copied by the non-root
// owner when gocryptfs is running as root
// ( https://github.com/rfjakob/gocryptfs/issues/539 ).
// ( https://github.com/rfjakob/gocryptfs/v2/issues/539 ).
dirivPerms = 0444
// Permissions for gocryptfs.longname.[sha256].name files.

2
internal/openfiletable/open_file_table.go

@ -8,7 +8,7 @@ import (
"sync"
"sync/atomic"
"github.com/rfjakob/gocryptfs/internal/inomap"
"github.com/rfjakob/gocryptfs/v2/internal/inomap"
)
// wlock - serializes write accesses to each file (identified by inode number)

2
internal/pathiv/pathiv.go

@ -4,7 +4,7 @@ import (
"crypto/sha256"
"encoding/binary"
"github.com/rfjakob/gocryptfs/internal/nametransform"
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
)
// Purpose identifies for which purpose the IV will be used. This is mixed into the

2
internal/readpassword/extpass_test.go

@ -5,7 +5,7 @@ import (
"os/exec"
"testing"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
func TestMain(m *testing.M) {

4
internal/readpassword/passfile.go

@ -4,8 +4,8 @@ import (
"bytes"
"os"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// readPassFileConcatenate reads the first line from each file name and

4
internal/readpassword/read.go

@ -11,8 +11,8 @@ import (
"golang.org/x/crypto/ssh/terminal"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
const (

2
internal/serialize_reads/sr.go

@ -5,7 +5,7 @@ import (
"sync"
"time"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
// serializerState is used by the Wait and Done functions

4
internal/speed/speed.go

@ -14,8 +14,8 @@ import (
"golang.org/x/crypto/chacha20poly1305"
"github.com/rfjakob/gocryptfs/internal/siv_aead"
"github.com/rfjakob/gocryptfs/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/v2/internal/siv_aead"
"github.com/rfjakob/gocryptfs/v2/internal/stupidgcm"
)
// 128-bit file ID + 64 bit block number = 192 bits = 24 bytes

2
internal/speed/speed_test.go

@ -9,7 +9,7 @@ BenchmarkStupidGCM-2 100000 22552 ns/op 181.62 MB/s
BenchmarkGoGCM-2 20000 81871 ns/op 50.03 MB/s
BenchmarkAESSIV-2 10000 104623 ns/op 39.15 MB/s
PASS
ok github.com/rfjakob/gocryptfs/internal/speed 6.022s
ok github.com/rfjakob/gocryptfs/v2/internal/speed 6.022s
*/
import (

4
internal/stupidgcm/prefer.go

@ -14,7 +14,7 @@ import (
// 2) Is ARM64 && has AES instructions && Go is v1.11 or higher
// (commit https://github.com/golang/go/commit/4f1f503373cda7160392be94e3849b0c9b9ebbda)
//
// See https://github.com/rfjakob/gocryptfs/wiki/CPU-Benchmarks
// See https://github.com/rfjakob/gocryptfs/v2/wiki/CPU-Benchmarks
// for benchmarks.
func PreferOpenSSL() bool {
if BuiltWithoutOpenssl {
@ -26,7 +26,7 @@ func PreferOpenSSL() bool {
return false
}
// On the Apple M1, Go stdlib is faster than OpenSSL, despite cpu.ARM64.HasAES
// reading false: https://github.com/rfjakob/gocryptfs/issues/556#issuecomment-848079309
// reading false: https://github.com/rfjakob/gocryptfs/v2/issues/556#issuecomment-848079309
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
return false
}

2
internal/stupidgcm/without_openssl.go

@ -6,7 +6,7 @@ import (
"fmt"
"os"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
)
type StupidGCM struct{}

2
internal/syscallcompat/eintr.go

@ -12,7 +12,7 @@ import (
// https://github.com/golang/go/blob/d2a80f3fb5b44450e0b304ac5a718f99c053d82a/src/os/file_posix.go#L243
//
// This is needed because CIFS throws lots of EINTR errors:
// https://github.com/rfjakob/gocryptfs/issues/483
// https://github.com/rfjakob/gocryptfs/v2/issues/483
//
// Don't use retryEINTR() with syscall.Close()!
// See https://code.google.com/p/chromium/issues/detail?id=269623 .

8
internal/syscallcompat/getdents_linux.go

@ -16,14 +16,14 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/rfjakob/gocryptfs/internal/tlog"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
const sizeofDirent = int(unsafe.Sizeof(unix.Dirent{}))
// maxReclen sanity check: Reclen should never be larger than this.
// Due to padding between entries, it is 280 even on 32-bit architectures.
// See https://github.com/rfjakob/gocryptfs/issues/197 for details.
// See https://github.com/rfjakob/gocryptfs/v2/issues/197 for details.
const maxReclen = 280
// getdents wraps unix.Getdents and converts the result to []fuse.DirEntry.
@ -43,7 +43,7 @@ func getdents(fd int) (entries []fuse.DirEntry, entriesSpecial []fuse.DirEntry,
continue
} else if err != nil {
if smartBuf.Len() > 0 {
tlog.Warn.Printf("warning: unix.Getdents returned errno %d in the middle of data ( https://github.com/rfjakob/gocryptfs/issues/483 )", err.(syscall.Errno))
tlog.Warn.Printf("warning: unix.Getdents returned errno %d in the middle of data ( https://github.com/rfjakob/gocryptfs/v2/issues/483 )", err.(syscall.Errno))
return nil, nil, syscall.EIO
}
return nil, nil, err
@ -145,7 +145,7 @@ func dtUnknownWarn(dirfd int) {
if err == nil && buf.Type == XFS_SUPER_MAGIC {
// Old XFS filesystems always return DT_UNKNOWN. Downgrade the message
// to "info" level if we are on XFS.
// https://github.com/rfjakob/gocryptfs/issues/267
// https://github.com/rfjakob/gocryptfs/v2/issues/267
tlog.Info.Printf("Getdents: convertDType: received DT_UNKNOWN, fstype=xfs, falling back to stat")
} else {
tlog.Warn.Printf("Getdents: convertDType: received DT_UNKNOWN, fstype=%#x, falling back to stat",

2
internal/syscallcompat/getdents_test.go

@ -27,7 +27,7 @@ func TestGetdents(t *testing.T) {