From 69d88505fd7f4cb0d9e4f1918de296342fe05858 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Mon, 23 Aug 2021 15:05:15 +0200 Subject: 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/% --- internal/syscallcompat/eintr.go | 2 +- internal/syscallcompat/getdents_linux.go | 8 ++++---- internal/syscallcompat/getdents_test.go | 2 +- internal/syscallcompat/open_nofollow.go | 2 +- internal/syscallcompat/quirks.go | 8 ++++---- internal/syscallcompat/quirks_darwin.go | 8 ++++---- internal/syscallcompat/quirks_linux.go | 8 ++++---- internal/syscallcompat/sys_common.go | 2 +- internal/syscallcompat/sys_darwin.go | 2 +- internal/syscallcompat/sys_linux.go | 4 ++-- 10 files changed, 23 insertions(+), 23 deletions(-) (limited to 'internal/syscallcompat') diff --git a/internal/syscallcompat/eintr.go b/internal/syscallcompat/eintr.go index cdde806..2e2bb18 100644 --- a/internal/syscallcompat/eintr.go +++ b/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 . diff --git a/internal/syscallcompat/getdents_linux.go b/internal/syscallcompat/getdents_linux.go index 852b3cd..2ad7cde 100644 --- a/internal/syscallcompat/getdents_linux.go +++ b/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", diff --git a/internal/syscallcompat/getdents_test.go b/internal/syscallcompat/getdents_test.go index a6f41ca..6c746bc 100644 --- a/internal/syscallcompat/getdents_test.go +++ b/internal/syscallcompat/getdents_test.go @@ -27,7 +27,7 @@ func TestGetdents(t *testing.T) { // skipOnGccGo skips the emulateGetdents test when we are // running linux and were compiled with gccgo. The test is known to fail -// (https://github.com/rfjakob/gocryptfs/issues/201), but getdents emulation +// (https://github.com/rfjakob/gocryptfs/v2/issues/201), but getdents emulation // is not used on linux, so let's skip the test and ignore the failure. func skipOnGccGo(t *testing.T) { if !emulate || runtime.GOOS != "linux" { diff --git a/internal/syscallcompat/open_nofollow.go b/internal/syscallcompat/open_nofollow.go index f8e50e3..da28938 100644 --- a/internal/syscallcompat/open_nofollow.go +++ b/internal/syscallcompat/open_nofollow.go @@ -5,7 +5,7 @@ import ( "strings" "syscall" - "github.com/rfjakob/gocryptfs/internal/tlog" + "github.com/rfjakob/gocryptfs/v2/internal/tlog" ) // OpenDirNofollow opens the dir at "relPath" in a way that is secure against diff --git a/internal/syscallcompat/quirks.go b/internal/syscallcompat/quirks.go index 60d584d..cfcf3ff 100644 --- a/internal/syscallcompat/quirks.go +++ b/internal/syscallcompat/quirks.go @@ -1,17 +1,17 @@ package syscallcompat import ( - "github.com/rfjakob/gocryptfs/internal/tlog" + "github.com/rfjakob/gocryptfs/v2/internal/tlog" ) const ( // QuirkBrokenFalloc means the falloc is broken. - // Preallocation on Btrfs is broken ( https://github.com/rfjakob/gocryptfs/issues/395 ) - // and slow ( https://github.com/rfjakob/gocryptfs/issues/63 ). + // Preallocation on Btrfs is broken ( https://github.com/rfjakob/gocryptfs/v2/issues/395 ) + // and slow ( https://github.com/rfjakob/gocryptfs/v2/issues/63 ). QuirkBrokenFalloc = uint64(1 << iota) // QuirkDuplicateIno1 means that we have duplicate inode numbers. // On MacOS ExFAT, all empty files share inode number 1: - // https://github.com/rfjakob/gocryptfs/issues/585 + // https://github.com/rfjakob/gocryptfs/v2/issues/585 QuirkDuplicateIno1 ) diff --git a/internal/syscallcompat/quirks_darwin.go b/internal/syscallcompat/quirks_darwin.go index f4e7e71..aca3d99 100644 --- a/internal/syscallcompat/quirks_darwin.go +++ b/internal/syscallcompat/quirks_darwin.go @@ -3,12 +3,12 @@ package syscallcompat import ( "golang.org/x/sys/unix" - "github.com/rfjakob/gocryptfs/internal/tlog" + "github.com/rfjakob/gocryptfs/v2/internal/tlog" ) func DetectQuirks(cipherdir string) (q uint64) { const ( - // From https://github.com/rfjakob/gocryptfs/issues/585#issuecomment-887370065 + // From https://github.com/rfjakob/gocryptfs/v2/issues/585#issuecomment-887370065 FstypenameExfat = "exfat" ) @@ -31,9 +31,9 @@ func DetectQuirks(cipherdir string) (q uint64) { tlog.Debug.Printf("DetectQuirks: Fstypename=%q\n", fstypename) // On MacOS ExFAT, all empty files share inode number 1: - // https://github.com/rfjakob/gocryptfs/issues/585 + // https://github.com/rfjakob/gocryptfs/v2/issues/585 if fstypename == FstypenameExfat { - logQuirk("ExFAT detected, disabling hard links. See https://github.com/rfjakob/gocryptfs/issues/585 for why.") + logQuirk("ExFAT detected, disabling hard links. See https://github.com/rfjakob/gocryptfs/v2/issues/585 for why.") q |= QuirkDuplicateIno1 } diff --git a/internal/syscallcompat/quirks_linux.go b/internal/syscallcompat/quirks_linux.go index 262e48f..418f010 100644 --- a/internal/syscallcompat/quirks_linux.go +++ b/internal/syscallcompat/quirks_linux.go @@ -3,7 +3,7 @@ package syscallcompat import ( "golang.org/x/sys/unix" - "github.com/rfjakob/gocryptfs/internal/tlog" + "github.com/rfjakob/gocryptfs/v2/internal/tlog" ) // DetectQuirks decides if there are known quirks on the backing filesystem @@ -18,12 +18,12 @@ func DetectQuirks(cipherdir string) (q uint64) { return 0 } - // Preallocation on Btrfs is broken ( https://github.com/rfjakob/gocryptfs/issues/395 ) - // and slow ( https://github.com/rfjakob/gocryptfs/issues/63 ). + // Preallocation on Btrfs is broken ( https://github.com/rfjakob/gocryptfs/v2/issues/395 ) + // and slow ( https://github.com/rfjakob/gocryptfs/v2/issues/63 ). // // Cast to uint32 avoids compile error on arm: "constant 2435016766 overflows int32" if uint32(st.Type) == unix.BTRFS_SUPER_MAGIC { - logQuirk("Btrfs detected, forcing -noprealloc. See https://github.com/rfjakob/gocryptfs/issues/395 for why.") + logQuirk("Btrfs detected, forcing -noprealloc. See https://github.com/rfjakob/gocryptfs/v2/issues/395 for why.") q |= QuirkBrokenFalloc } diff --git a/internal/syscallcompat/sys_common.go b/internal/syscallcompat/sys_common.go index fc020bd..50b8180 100644 --- a/internal/syscallcompat/sys_common.go +++ b/internal/syscallcompat/sys_common.go @@ -6,7 +6,7 @@ import ( "golang.org/x/sys/unix" - "github.com/rfjakob/gocryptfs/internal/tlog" + "github.com/rfjakob/gocryptfs/v2/internal/tlog" ) // PATH_MAX is the maximum allowed path length on Linux. diff --git a/internal/syscallcompat/sys_darwin.go b/internal/syscallcompat/sys_darwin.go index 075563f..e35f213 100644 --- a/internal/syscallcompat/sys_darwin.go +++ b/internal/syscallcompat/sys_darwin.go @@ -59,7 +59,7 @@ func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintp // Sorry, fallocate is not available on OSX at all and // fcntl F_PREALLOCATE is not accessible from Go. -// See https://github.com/rfjakob/gocryptfs/issues/18 if you want to help. +// See https://github.com/rfjakob/gocryptfs/v2/issues/18 if you want to help. func EnospcPrealloc(fd int, off int64, len int64) error { return nil } diff --git a/internal/syscallcompat/sys_linux.go b/internal/syscallcompat/sys_linux.go index a1d7d40..b7f1dad 100644 --- a/internal/syscallcompat/sys_linux.go +++ b/internal/syscallcompat/sys_linux.go @@ -15,7 +15,7 @@ import ( "github.com/hanwen/go-fuse/v2/fuse" - "github.com/rfjakob/gocryptfs/internal/tlog" + "github.com/rfjakob/gocryptfs/v2/internal/tlog" ) const ( @@ -48,7 +48,7 @@ func EnospcPrealloc(fd int, off int64, len int64) (err error) { } if err == syscall.EOPNOTSUPP { // ZFS and ext3 do not support fallocate. Warn but continue anyway. - // https://github.com/rfjakob/gocryptfs/issues/22 + // https://github.com/rfjakob/gocryptfs/v2/issues/22 preallocWarn.Do(func() { tlog.Warn.Printf("Warning: The underlying filesystem " + "does not support fallocate(2). gocryptfs will continue working " + -- cgit v1.2.3