Unbreak hyperlinks broken by go mod v2 conversion
Commit
69d88505fd
go mod: declare module version v2
translated all instances of "github.com/rfjakob/gocryptfs/" to
"github.com/rfjakob/gocryptfs/v2/".
Unfortunately, this included hyperlinks.
Unbreak the hyperlinks like this:
find . -name \*.go | xargs sed -i s%https://github.com/rfjakob/gocryptfs/v2/%https://github.com/rfjakob/gocryptfs/v2/%
This commit is contained in:
parent
17fe50ef74
commit
34d8a498c4
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Small tool to try to debug unix.Getdents problems on CIFS mounts
|
Small tool to try to debug unix.Getdents problems on CIFS mounts
|
||||||
( https://github.com/rfjakob/gocryptfs/v2/issues/483 )
|
( https://github.com/rfjakob/gocryptfs/issues/483 )
|
||||||
|
|
||||||
Example output:
|
Example output:
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Small tool to try to debug unix.Getdents problems on CIFS mounts
|
Small tool to try to debug unix.Getdents problems on CIFS mounts
|
||||||
( https://github.com/rfjakob/gocryptfs/v2/issues/483 )
|
( https://github.com/rfjakob/gocryptfs/issues/483 )
|
||||||
|
|
||||||
Example output:
|
Example output:
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ func (cf *ConfFile) WriteFile() error {
|
|||||||
err = fd.Sync()
|
err = fd.Sync()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// This can happen on network drives: FRITZ.NAS mounted on MacOS returns
|
// This can happen on network drives: FRITZ.NAS mounted on MacOS returns
|
||||||
// "operation not supported": https://github.com/rfjakob/gocryptfs/v2/issues/390
|
// "operation not supported": https://github.com/rfjakob/gocryptfs/issues/390
|
||||||
tlog.Warn.Printf("Warning: fsync failed: %v", err)
|
tlog.Warn.Printf("Warning: fsync failed: %v", err)
|
||||||
// Try sync instead
|
// Try sync instead
|
||||||
syscall.Sync()
|
syscall.Sync()
|
||||||
|
@ -167,7 +167,7 @@ func (be *ContentEnc) DecryptBlock(ciphertext []byte, blockNo uint64, fileID []b
|
|||||||
nonce := ciphertext[:be.cryptoCore.IVLen]
|
nonce := ciphertext[:be.cryptoCore.IVLen]
|
||||||
if bytes.Equal(nonce, be.allZeroNonce) {
|
if bytes.Equal(nonce, be.allZeroNonce) {
|
||||||
// Bug in tmpfs?
|
// Bug in tmpfs?
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/56
|
// https://github.com/rfjakob/gocryptfs/issues/56
|
||||||
// http://www.spinics.net/lists/kernel/msg2370127.html
|
// http://www.spinics.net/lists/kernel/msg2370127.html
|
||||||
return nil, errors.New("all-zero nonce")
|
return nil, errors.New("all-zero nonce")
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
// l-wx------. 1 jakob jakob 64 Jan 5 15:54 3 -> /dev/null
|
// 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]'
|
// lrwx------. 1 jakob jakob 64 Jan 5 15:54 4 -> 'anon_inode:[eventpoll]'
|
||||||
//
|
//
|
||||||
// See https://github.com/rfjakob/gocryptfs/v2/issues/320 for details.
|
// See https://github.com/rfjakob/gocryptfs/issues/320 for details.
|
||||||
package ensurefds012
|
package ensurefds012
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -40,7 +40,7 @@ type Args struct {
|
|||||||
// Suid is true if the filesystem has been mounted with the "-suid" flag.
|
// 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,
|
// If it is false, we can ignore the GETXATTR "security.capability" calls,
|
||||||
// which are a performance problem for writes. See
|
// which are a performance problem for writes. See
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/515 for details.
|
// https://github.com/rfjakob/gocryptfs/issues/515 for details.
|
||||||
Suid bool
|
Suid bool
|
||||||
// Enable the FUSE kernel_cache option
|
// Enable the FUSE kernel_cache option
|
||||||
KernelCache bool
|
KernelCache bool
|
||||||
|
@ -24,7 +24,7 @@ var xattrNameIV = []byte("xattr_name_iv_xx")
|
|||||||
var xattrStorePrefix = "user.gocryptfs."
|
var xattrStorePrefix = "user.gocryptfs."
|
||||||
|
|
||||||
// We get one read of this xattr for each write -
|
// We get one read of this xattr for each write -
|
||||||
// see https://github.com/rfjakob/gocryptfs/v2/issues/515 for details.
|
// see https://github.com/rfjakob/gocryptfs/issues/515 for details.
|
||||||
var xattrCapability = "security.capability"
|
var xattrCapability = "security.capability"
|
||||||
|
|
||||||
// isAcl returns true if the attribute name is for storing ACLs
|
// 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()
|
rn := n.rootNode()
|
||||||
// If we are not mounted with -suid, reading the capability xattr does not
|
// 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.
|
// make a lot of sense, so reject the request and gain a massive speedup.
|
||||||
// See https://github.com/rfjakob/gocryptfs/v2/issues/515 .
|
// See https://github.com/rfjakob/gocryptfs/issues/515 .
|
||||||
if !rn.args.Suid && attr == xattrCapability {
|
if !rn.args.Suid && attr == xattrCapability {
|
||||||
// Returning EOPNOTSUPP is what we did till
|
// Returning EOPNOTSUPP is what we did till
|
||||||
// ca9e912a28b901387e1dbb85f6c531119f2d5ef2 "fusefrontend: drop xattr user namespace restriction"
|
// ca9e912a28b901387e1dbb85f6c531119f2d5ef2 "fusefrontend: drop xattr user namespace restriction"
|
||||||
|
@ -68,7 +68,7 @@ func WriteDirIVAt(dirfd int) error {
|
|||||||
iv := cryptocore.RandBytes(DirIVLen)
|
iv := cryptocore.RandBytes(DirIVLen)
|
||||||
// 0400 permissions: gocryptfs.diriv should never be modified after creation.
|
// 0400 permissions: gocryptfs.diriv should never be modified after creation.
|
||||||
// Don't use "ioutil.WriteFile", it causes trouble on NFS:
|
// Don't use "ioutil.WriteFile", it causes trouble on NFS:
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/commit/7d38f80a78644c8ec4900cc990bfb894387112ed
|
// https://github.com/rfjakob/gocryptfs/commit/7d38f80a78644c8ec4900cc990bfb894387112ed
|
||||||
fd, err := syscallcompat.Openat(dirfd, DirIVFilename, os.O_WRONLY|os.O_CREATE|os.O_EXCL, dirivPerms)
|
fd, err := syscallcompat.Openat(dirfd, DirIVFilename, os.O_WRONLY|os.O_CREATE|os.O_EXCL, dirivPerms)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tlog.Warn.Printf("WriteDirIV: Openat: %v", err)
|
tlog.Warn.Printf("WriteDirIV: Openat: %v", err)
|
||||||
|
@ -6,14 +6,14 @@ const (
|
|||||||
// never chmod'ed or chown'ed.
|
// never chmod'ed or chown'ed.
|
||||||
//
|
//
|
||||||
// Group-readable so the FS can be mounted by several users in the same group
|
// Group-readable so the FS can be mounted by several users in the same group
|
||||||
// (see https://github.com/rfjakob/gocryptfs/v2/issues/387 ).
|
// (see https://github.com/rfjakob/gocryptfs/issues/387 ).
|
||||||
//
|
//
|
||||||
// Note that gocryptfs.conf is still created with 0400 permissions so the
|
// Note that gocryptfs.conf is still created with 0400 permissions so the
|
||||||
// owner must explicitly chmod it to permit access.
|
// owner must explicitly chmod it to permit access.
|
||||||
//
|
//
|
||||||
// World-readable so an encrypted directory can be copied by the non-root
|
// World-readable so an encrypted directory can be copied by the non-root
|
||||||
// owner when gocryptfs is running as root
|
// owner when gocryptfs is running as root
|
||||||
// ( https://github.com/rfjakob/gocryptfs/v2/issues/539 ).
|
// ( https://github.com/rfjakob/gocryptfs/issues/539 ).
|
||||||
dirivPerms = 0444
|
dirivPerms = 0444
|
||||||
|
|
||||||
// Permissions for gocryptfs.longname.[sha256].name files.
|
// Permissions for gocryptfs.longname.[sha256].name files.
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
// 2) Is ARM64 && has AES instructions && Go is v1.11 or higher
|
// 2) Is ARM64 && has AES instructions && Go is v1.11 or higher
|
||||||
// (commit https://github.com/golang/go/commit/4f1f503373cda7160392be94e3849b0c9b9ebbda)
|
// (commit https://github.com/golang/go/commit/4f1f503373cda7160392be94e3849b0c9b9ebbda)
|
||||||
//
|
//
|
||||||
// See https://github.com/rfjakob/gocryptfs/v2/wiki/CPU-Benchmarks
|
// See https://github.com/rfjakob/gocryptfs/wiki/CPU-Benchmarks
|
||||||
// for benchmarks.
|
// for benchmarks.
|
||||||
func PreferOpenSSL() bool {
|
func PreferOpenSSL() bool {
|
||||||
if BuiltWithoutOpenssl {
|
if BuiltWithoutOpenssl {
|
||||||
@ -26,7 +26,7 @@ func PreferOpenSSL() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// On the Apple M1, Go stdlib is faster than OpenSSL, despite cpu.ARM64.HasAES
|
// On the Apple M1, Go stdlib is faster than OpenSSL, despite cpu.ARM64.HasAES
|
||||||
// reading false: https://github.com/rfjakob/gocryptfs/v2/issues/556#issuecomment-848079309
|
// reading false: https://github.com/rfjakob/gocryptfs/issues/556#issuecomment-848079309
|
||||||
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
|
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
// https://github.com/golang/go/blob/d2a80f3fb5b44450e0b304ac5a718f99c053d82a/src/os/file_posix.go#L243
|
// https://github.com/golang/go/blob/d2a80f3fb5b44450e0b304ac5a718f99c053d82a/src/os/file_posix.go#L243
|
||||||
//
|
//
|
||||||
// This is needed because CIFS throws lots of EINTR errors:
|
// This is needed because CIFS throws lots of EINTR errors:
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/483
|
// https://github.com/rfjakob/gocryptfs/issues/483
|
||||||
//
|
//
|
||||||
// Don't use retryEINTR() with syscall.Close()!
|
// Don't use retryEINTR() with syscall.Close()!
|
||||||
// See https://code.google.com/p/chromium/issues/detail?id=269623 .
|
// See https://code.google.com/p/chromium/issues/detail?id=269623 .
|
||||||
|
@ -23,7 +23,7 @@ const sizeofDirent = int(unsafe.Sizeof(unix.Dirent{}))
|
|||||||
|
|
||||||
// maxReclen sanity check: Reclen should never be larger than this.
|
// maxReclen sanity check: Reclen should never be larger than this.
|
||||||
// Due to padding between entries, it is 280 even on 32-bit architectures.
|
// Due to padding between entries, it is 280 even on 32-bit architectures.
|
||||||
// See https://github.com/rfjakob/gocryptfs/v2/issues/197 for details.
|
// See https://github.com/rfjakob/gocryptfs/issues/197 for details.
|
||||||
const maxReclen = 280
|
const maxReclen = 280
|
||||||
|
|
||||||
// getdents wraps unix.Getdents and converts the result to []fuse.DirEntry.
|
// 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
|
continue
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
if smartBuf.Len() > 0 {
|
if smartBuf.Len() > 0 {
|
||||||
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))
|
tlog.Warn.Printf("warning: unix.Getdents returned errno %d in the middle of data ( https://github.com/rfjakob/gocryptfs/issues/483 )", err.(syscall.Errno))
|
||||||
return nil, nil, syscall.EIO
|
return nil, nil, syscall.EIO
|
||||||
}
|
}
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
@ -145,7 +145,7 @@ func dtUnknownWarn(dirfd int) {
|
|||||||
if err == nil && buf.Type == XFS_SUPER_MAGIC {
|
if err == nil && buf.Type == XFS_SUPER_MAGIC {
|
||||||
// Old XFS filesystems always return DT_UNKNOWN. Downgrade the message
|
// Old XFS filesystems always return DT_UNKNOWN. Downgrade the message
|
||||||
// to "info" level if we are on XFS.
|
// to "info" level if we are on XFS.
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/267
|
// https://github.com/rfjakob/gocryptfs/issues/267
|
||||||
tlog.Info.Printf("Getdents: convertDType: received DT_UNKNOWN, fstype=xfs, falling back to stat")
|
tlog.Info.Printf("Getdents: convertDType: received DT_UNKNOWN, fstype=xfs, falling back to stat")
|
||||||
} else {
|
} else {
|
||||||
tlog.Warn.Printf("Getdents: convertDType: received DT_UNKNOWN, fstype=%#x, falling back to stat",
|
tlog.Warn.Printf("Getdents: convertDType: received DT_UNKNOWN, fstype=%#x, falling back to stat",
|
||||||
|
@ -27,7 +27,7 @@ func TestGetdents(t *testing.T) {
|
|||||||
|
|
||||||
// skipOnGccGo skips the emulateGetdents test when we are
|
// skipOnGccGo skips the emulateGetdents test when we are
|
||||||
// running linux and were compiled with gccgo. The test is known to fail
|
// running linux and were compiled with gccgo. The test is known to fail
|
||||||
// (https://github.com/rfjakob/gocryptfs/v2/issues/201), but getdents emulation
|
// (https://github.com/rfjakob/gocryptfs/issues/201), but getdents emulation
|
||||||
// is not used on linux, so let's skip the test and ignore the failure.
|
// is not used on linux, so let's skip the test and ignore the failure.
|
||||||
func skipOnGccGo(t *testing.T) {
|
func skipOnGccGo(t *testing.T) {
|
||||||
if !emulate || runtime.GOOS != "linux" {
|
if !emulate || runtime.GOOS != "linux" {
|
||||||
|
@ -6,12 +6,12 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// QuirkBrokenFalloc means the falloc is broken.
|
// QuirkBrokenFalloc means the falloc is broken.
|
||||||
// Preallocation on Btrfs is broken ( https://github.com/rfjakob/gocryptfs/v2/issues/395 )
|
// Preallocation on Btrfs is broken ( https://github.com/rfjakob/gocryptfs/issues/395 )
|
||||||
// and slow ( https://github.com/rfjakob/gocryptfs/v2/issues/63 ).
|
// and slow ( https://github.com/rfjakob/gocryptfs/issues/63 ).
|
||||||
QuirkBrokenFalloc = uint64(1 << iota)
|
QuirkBrokenFalloc = uint64(1 << iota)
|
||||||
// QuirkDuplicateIno1 means that we have duplicate inode numbers.
|
// QuirkDuplicateIno1 means that we have duplicate inode numbers.
|
||||||
// On MacOS ExFAT, all empty files share inode number 1:
|
// On MacOS ExFAT, all empty files share inode number 1:
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/585
|
// https://github.com/rfjakob/gocryptfs/issues/585
|
||||||
QuirkDuplicateIno1
|
QuirkDuplicateIno1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
func DetectQuirks(cipherdir string) (q uint64) {
|
func DetectQuirks(cipherdir string) (q uint64) {
|
||||||
const (
|
const (
|
||||||
// From https://github.com/rfjakob/gocryptfs/v2/issues/585#issuecomment-887370065
|
// From https://github.com/rfjakob/gocryptfs/issues/585#issuecomment-887370065
|
||||||
FstypenameExfat = "exfat"
|
FstypenameExfat = "exfat"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -31,9 +31,9 @@ func DetectQuirks(cipherdir string) (q uint64) {
|
|||||||
tlog.Debug.Printf("DetectQuirks: Fstypename=%q\n", fstypename)
|
tlog.Debug.Printf("DetectQuirks: Fstypename=%q\n", fstypename)
|
||||||
|
|
||||||
// On MacOS ExFAT, all empty files share inode number 1:
|
// On MacOS ExFAT, all empty files share inode number 1:
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/585
|
// https://github.com/rfjakob/gocryptfs/issues/585
|
||||||
if fstypename == FstypenameExfat {
|
if fstypename == FstypenameExfat {
|
||||||
logQuirk("ExFAT detected, disabling hard links. See https://github.com/rfjakob/gocryptfs/v2/issues/585 for why.")
|
logQuirk("ExFAT detected, disabling hard links. See https://github.com/rfjakob/gocryptfs/issues/585 for why.")
|
||||||
q |= QuirkDuplicateIno1
|
q |= QuirkDuplicateIno1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,12 +18,12 @@ func DetectQuirks(cipherdir string) (q uint64) {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// Preallocation on Btrfs is broken ( https://github.com/rfjakob/gocryptfs/v2/issues/395 )
|
// Preallocation on Btrfs is broken ( https://github.com/rfjakob/gocryptfs/issues/395 )
|
||||||
// and slow ( https://github.com/rfjakob/gocryptfs/v2/issues/63 ).
|
// and slow ( https://github.com/rfjakob/gocryptfs/issues/63 ).
|
||||||
//
|
//
|
||||||
// Cast to uint32 avoids compile error on arm: "constant 2435016766 overflows int32"
|
// Cast to uint32 avoids compile error on arm: "constant 2435016766 overflows int32"
|
||||||
if uint32(st.Type) == unix.BTRFS_SUPER_MAGIC {
|
if uint32(st.Type) == unix.BTRFS_SUPER_MAGIC {
|
||||||
logQuirk("Btrfs detected, forcing -noprealloc. See https://github.com/rfjakob/gocryptfs/v2/issues/395 for why.")
|
logQuirk("Btrfs detected, forcing -noprealloc. See https://github.com/rfjakob/gocryptfs/issues/395 for why.")
|
||||||
q |= QuirkBrokenFalloc
|
q |= QuirkBrokenFalloc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
// Sorry, fallocate is not available on OSX at all and
|
||||||
// fcntl F_PREALLOCATE is not accessible from Go.
|
// fcntl F_PREALLOCATE is not accessible from Go.
|
||||||
// See https://github.com/rfjakob/gocryptfs/v2/issues/18 if you want to help.
|
// See https://github.com/rfjakob/gocryptfs/issues/18 if you want to help.
|
||||||
func EnospcPrealloc(fd int, off int64, len int64) error {
|
func EnospcPrealloc(fd int, off int64, len int64) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ func EnospcPrealloc(fd int, off int64, len int64) (err error) {
|
|||||||
}
|
}
|
||||||
if err == syscall.EOPNOTSUPP {
|
if err == syscall.EOPNOTSUPP {
|
||||||
// ZFS and ext3 do not support fallocate. Warn but continue anyway.
|
// ZFS and ext3 do not support fallocate. Warn but continue anyway.
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/22
|
// https://github.com/rfjakob/gocryptfs/issues/22
|
||||||
preallocWarn.Do(func() {
|
preallocWarn.Do(func() {
|
||||||
tlog.Warn.Printf("Warning: The underlying filesystem " +
|
tlog.Warn.Printf("Warning: The underlying filesystem " +
|
||||||
"does not support fallocate(2). gocryptfs will continue working " +
|
"does not support fallocate(2). gocryptfs will continue working " +
|
||||||
|
2
main.go
2
main.go
@ -1,5 +1,5 @@
|
|||||||
// gocryptfs is an encrypted overlay filesystem written in Go.
|
// gocryptfs is an encrypted overlay filesystem written in Go.
|
||||||
// See README.md ( https://github.com/rfjakob/gocryptfs/v2/blob/master/README.md )
|
// See README.md ( https://github.com/rfjakob/gocryptfs/blob/master/README.md )
|
||||||
// and the official website ( https://nuetzlich.net/gocryptfs/ ) for details.
|
// and the official website ( https://nuetzlich.net/gocryptfs/ ) for details.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
2
mount.go
2
mount.go
@ -75,7 +75,7 @@ func doMount(args *argContainer) {
|
|||||||
// and `drop_privileges` in `man mount.fuse3` for background.
|
// and `drop_privileges` in `man mount.fuse3` for background.
|
||||||
} else {
|
} else {
|
||||||
err = isEmptyDir(args.mountpoint)
|
err = isEmptyDir(args.mountpoint)
|
||||||
// OSXFuse will create the mountpoint for us ( https://github.com/rfjakob/gocryptfs/v2/issues/194 )
|
// OSXFuse will create the mountpoint for us ( https://github.com/rfjakob/gocryptfs/issues/194 )
|
||||||
if runtime.GOOS == "darwin" && os.IsNotExist(err) {
|
if runtime.GOOS == "darwin" && os.IsNotExist(err) {
|
||||||
tlog.Info.Printf("Mountpoint %q does not exist, but should be created by OSXFuse",
|
tlog.Info.Printf("Mountpoint %q does not exist, but should be created by OSXFuse",
|
||||||
args.mountpoint)
|
args.mountpoint)
|
||||||
|
@ -60,9 +60,9 @@ func TestInitFilePerms(t *testing.T) {
|
|||||||
syscall.Stat(dir+"/gocryptfs.diriv", &st)
|
syscall.Stat(dir+"/gocryptfs.diriv", &st)
|
||||||
perms = st.Mode & 0777
|
perms = st.Mode & 0777
|
||||||
// From v1.7.1, these are created with 0440 permissions, see
|
// From v1.7.1, these are created with 0440 permissions, see
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/387 .
|
// https://github.com/rfjakob/gocryptfs/issues/387 .
|
||||||
// From v2.0, created with 0444 perms, see
|
// From v2.0, created with 0444 perms, see
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/539 .
|
// https://github.com/rfjakob/gocryptfs/issues/539 .
|
||||||
if perms != 0444 {
|
if perms != 0444 {
|
||||||
t.Errorf("Wrong permissions for gocryptfs.diriv: %#o", perms)
|
t.Errorf("Wrong permissions for gocryptfs.diriv: %#o", perms)
|
||||||
}
|
}
|
||||||
@ -441,7 +441,7 @@ func TestPasswdPasswordIncorrect(t *testing.T) {
|
|||||||
// Check that we correctly background on mount and close stderr and stdout.
|
// Check that we correctly background on mount and close stderr and stdout.
|
||||||
// Something like
|
// Something like
|
||||||
// gocryptfs a b | cat
|
// gocryptfs a b | cat
|
||||||
// must not hang ( https://github.com/rfjakob/gocryptfs/v2/issues/130 ).
|
// must not hang ( https://github.com/rfjakob/gocryptfs/issues/130 ).
|
||||||
func TestMountBackground(t *testing.T) {
|
func TestMountBackground(t *testing.T) {
|
||||||
dir := test_helpers.InitFS(t)
|
dir := test_helpers.InitFS(t)
|
||||||
mnt := dir + ".mnt"
|
mnt := dir + ".mnt"
|
||||||
@ -557,7 +557,7 @@ func TestExcludeForward(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check that the config file can be read from a named pipe.
|
// Check that the config file can be read from a named pipe.
|
||||||
// Make sure bug https://github.com/rfjakob/gocryptfs/v2/issues/258 does not come
|
// Make sure bug https://github.com/rfjakob/gocryptfs/issues/258 does not come
|
||||||
// back.
|
// back.
|
||||||
func TestConfigPipe(t *testing.T) {
|
func TestConfigPipe(t *testing.T) {
|
||||||
dir := test_helpers.InitFS(t)
|
dir := test_helpers.InitFS(t)
|
||||||
@ -580,7 +580,7 @@ func TestConfigPipe(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ciphertext dir and mountpoint contains a comma
|
// Ciphertext dir and mountpoint contains a comma
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/262
|
// https://github.com/rfjakob/gocryptfs/issues/262
|
||||||
func TestComma(t *testing.T) {
|
func TestComma(t *testing.T) {
|
||||||
dir0 := test_helpers.InitFS(t)
|
dir0 := test_helpers.InitFS(t)
|
||||||
dir := dir0 + ",foo,bar"
|
dir := dir0 + ",foo,bar"
|
||||||
@ -625,7 +625,7 @@ func TestIdle(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mount with idle timeout of 100ms read something every 10ms. The fs should
|
// Mount with idle timeout of 100ms read something every 10ms. The fs should
|
||||||
// NOT get unmounted. Regression test for https://github.com/rfjakob/gocryptfs/v2/issues/421
|
// NOT get unmounted. Regression test for https://github.com/rfjakob/gocryptfs/issues/421
|
||||||
func TestNotIdle(t *testing.T) {
|
func TestNotIdle(t *testing.T) {
|
||||||
dir := test_helpers.InitFS(t)
|
dir := test_helpers.InitFS(t)
|
||||||
mnt := dir + ".mnt"
|
mnt := dir + ".mnt"
|
||||||
@ -663,7 +663,7 @@ func TestNotIdle(t *testing.T) {
|
|||||||
|
|
||||||
// TestSymlinkedCipherdir checks that if CIPHERDIR itself is a symlink, it is
|
// TestSymlinkedCipherdir checks that if CIPHERDIR itself is a symlink, it is
|
||||||
// followed.
|
// followed.
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/450
|
// https://github.com/rfjakob/gocryptfs/issues/450
|
||||||
func TestSymlinkedCipherdir(t *testing.T) {
|
func TestSymlinkedCipherdir(t *testing.T) {
|
||||||
dir := test_helpers.InitFS(t)
|
dir := test_helpers.InitFS(t)
|
||||||
dirSymlink := dir + ".symlink"
|
dirSymlink := dir + ".symlink"
|
||||||
@ -909,7 +909,7 @@ func TestPassfileX2(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TestInitNotEmpty checks that `gocryptfs -init` returns the right error code
|
// TestInitNotEmpty checks that `gocryptfs -init` returns the right error code
|
||||||
// if CIPHERDIR is not empty. See https://github.com/rfjakob/gocryptfs/v2/pull/503
|
// if CIPHERDIR is not empty. See https://github.com/rfjakob/gocryptfs/pull/503
|
||||||
func TestInitNotEmpty(t *testing.T) {
|
func TestInitNotEmpty(t *testing.T) {
|
||||||
dir := test_helpers.TmpDir + "/" + t.Name()
|
dir := test_helpers.TmpDir + "/" + t.Name()
|
||||||
if err := os.Mkdir(dir, 0700); err != nil {
|
if err := os.Mkdir(dir, 0700); err != nil {
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
"github.com/rfjakob/gocryptfs/v2/tests/test_helpers"
|
"github.com/rfjakob/gocryptfs/v2/tests/test_helpers"
|
||||||
)
|
)
|
||||||
|
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/543
|
// https://github.com/rfjakob/gocryptfs/issues/543
|
||||||
func TestCpA(t *testing.T) {
|
func TestCpA(t *testing.T) {
|
||||||
fn1 := filepath.Join(test_helpers.TmpDir, t.Name())
|
fn1 := filepath.Join(test_helpers.TmpDir, t.Name())
|
||||||
fn2 := filepath.Join(test_helpers.DefaultPlainDir, t.Name())
|
fn2 := filepath.Join(test_helpers.DefaultPlainDir, t.Name())
|
||||||
@ -77,7 +77,7 @@ func getfacl(fn string) (string, error) {
|
|||||||
return string(out), err
|
return string(out), err
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/543
|
// https://github.com/rfjakob/gocryptfs/issues/543
|
||||||
func TestAcl543(t *testing.T) {
|
func TestAcl543(t *testing.T) {
|
||||||
fn1 := test_helpers.TmpDir + "/TestAcl543"
|
fn1 := test_helpers.TmpDir + "/TestAcl543"
|
||||||
fn2 := test_helpers.DefaultPlainDir + "/TestAcl543"
|
fn2 := test_helpers.DefaultPlainDir + "/TestAcl543"
|
||||||
|
@ -239,7 +239,7 @@ func TestMvWarningSymlink(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Log(string(out))
|
t.Log(string(out))
|
||||||
if runtime.GOOS == "darwin" {
|
if runtime.GOOS == "darwin" {
|
||||||
t.Skip("mv on darwin chokes on broken symlinks, see https://github.com/rfjakob/gocryptfs/v2/issues/349")
|
t.Skip("mv on darwin chokes on broken symlinks, see https://github.com/rfjakob/gocryptfs/issues/349")
|
||||||
}
|
}
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/rfjakob/gocryptfs/v2/tests/test_helpers"
|
"github.com/rfjakob/gocryptfs/v2/tests/test_helpers"
|
||||||
)
|
)
|
||||||
|
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/363
|
// https://github.com/rfjakob/gocryptfs/issues/363
|
||||||
//
|
//
|
||||||
// Note: this test calls log.Fatal() instead of t.Fatal() because apparently,
|
// Note: this test calls log.Fatal() instead of t.Fatal() because apparently,
|
||||||
// calling t.Fatal() from a goroutine hangs the test.
|
// calling t.Fatal() from a goroutine hangs the test.
|
||||||
@ -73,7 +73,7 @@ func TestConcurrentReadWrite(t *testing.T) {
|
|||||||
wg.Wait()
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/363
|
// https://github.com/rfjakob/gocryptfs/issues/363
|
||||||
//
|
//
|
||||||
// Note: this test calls log.Fatal() instead of t.Fatal() because apparently,
|
// Note: this test calls log.Fatal() instead of t.Fatal() because apparently,
|
||||||
// calling t.Fatal() from a goroutine hangs the test.
|
// calling t.Fatal() from a goroutine hangs the test.
|
||||||
|
@ -34,7 +34,7 @@ func TestDirOverwrite(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Test that we can create and remove a directory regardless of the permission it has
|
// Test that we can create and remove a directory regardless of the permission it has
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/354
|
// https://github.com/rfjakob/gocryptfs/issues/354
|
||||||
func TestRmdirPerms(t *testing.T) {
|
func TestRmdirPerms(t *testing.T) {
|
||||||
for _, perm := range []uint32{0000, 0100, 0200, 0300, 0400, 0500, 0600, 0700} {
|
for _, perm := range []uint32{0000, 0100, 0200, 0300, 0400, 0500, 0600, 0700} {
|
||||||
dir := fmt.Sprintf("TestRmdir%#o", perm)
|
dir := fmt.Sprintf("TestRmdir%#o", perm)
|
||||||
|
@ -149,7 +149,7 @@ func TestFallocate(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// We used to allocate 18 bytes too much:
|
// We used to allocate 18 bytes too much:
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/311
|
// https://github.com/rfjakob/gocryptfs/issues/311
|
||||||
//
|
//
|
||||||
// 8110 bytes of plaintext should get us exactly 8192 bytes of ciphertext.
|
// 8110 bytes of plaintext should get us exactly 8192 bytes of ciphertext.
|
||||||
err = file.Truncate(0)
|
err = file.Truncate(0)
|
||||||
|
@ -774,7 +774,7 @@ func TestMkfifo(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TestMagicNames verifies that "magic" names are handled correctly
|
// TestMagicNames verifies that "magic" names are handled correctly
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/174
|
// https://github.com/rfjakob/gocryptfs/issues/174
|
||||||
func TestMagicNames(t *testing.T) {
|
func TestMagicNames(t *testing.T) {
|
||||||
names := []string{"warmup1", "warmup2", "gocryptfs.longname.QhUr5d9FHerwEs--muUs6_80cy6JRp89c1otLwp92Cs", "gocryptfs.diriv"}
|
names := []string{"warmup1", "warmup2", "gocryptfs.longname.QhUr5d9FHerwEs--muUs6_80cy6JRp89c1otLwp92Cs", "gocryptfs.diriv"}
|
||||||
for _, n := range names {
|
for _, n := range names {
|
||||||
@ -891,7 +891,7 @@ func TestStatfs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// gocryptfs 2.0 reported the ciphertext size on symlink creation, causing
|
// gocryptfs 2.0 reported the ciphertext size on symlink creation, causing
|
||||||
// confusion: https://github.com/rfjakob/gocryptfs/v2/issues/574
|
// confusion: https://github.com/rfjakob/gocryptfs/issues/574
|
||||||
func TestSymlinkSize(t *testing.T) {
|
func TestSymlinkSize(t *testing.T) {
|
||||||
p := filepath.Join(test_helpers.DefaultPlainDir, t.Name())
|
p := filepath.Join(test_helpers.DefaultPlainDir, t.Name())
|
||||||
// SYMLINK reports the size to the kernel
|
// SYMLINK reports the size to the kernel
|
||||||
@ -911,7 +911,7 @@ func TestSymlinkSize(t *testing.T) {
|
|||||||
// TestPwd check that /usr/bin/pwd works inside gocryptfs.
|
// TestPwd check that /usr/bin/pwd works inside gocryptfs.
|
||||||
//
|
//
|
||||||
// This was broken in gocryptfs v2.0 with -sharedstorage:
|
// This was broken in gocryptfs v2.0 with -sharedstorage:
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/584
|
// https://github.com/rfjakob/gocryptfs/issues/584
|
||||||
func TestPwd(t *testing.T) {
|
func TestPwd(t *testing.T) {
|
||||||
dir := test_helpers.DefaultPlainDir
|
dir := test_helpers.DefaultPlainDir
|
||||||
for i := 0; i < 3; i++ {
|
for i := 0; i < 3; i++ {
|
||||||
|
@ -185,7 +185,7 @@ func TestEnoent(t *testing.T) {
|
|||||||
// If the symlink target gets too long due to base64 encoding, we should
|
// If the symlink target gets too long due to base64 encoding, we should
|
||||||
// return ENAMETOOLONG instead of having the kernel reject the data and
|
// return ENAMETOOLONG instead of having the kernel reject the data and
|
||||||
// returning an I/O error to the user.
|
// returning an I/O error to the user.
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/167
|
// https://github.com/rfjakob/gocryptfs/issues/167
|
||||||
func TestTooLongSymlink(t *testing.T) {
|
func TestTooLongSymlink(t *testing.T) {
|
||||||
var err error
|
var err error
|
||||||
var l int
|
var l int
|
||||||
|
@ -128,7 +128,7 @@ func TestExcludeTestFs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Exclude everything using "/*", then selectively include only dir1 using "!/dir1"
|
// Exclude everything using "/*", then selectively include only dir1 using "!/dir1"
|
||||||
// https://github.com/rfjakob/gocryptfs/v2/issues/588
|
// https://github.com/rfjakob/gocryptfs/issues/588
|
||||||
func TestExcludeAllOnlyDir1(t *testing.T) {
|
func TestExcludeAllOnlyDir1(t *testing.T) {
|
||||||
// --exclude-wildcard patterns, gitignore syntax
|
// --exclude-wildcard patterns, gitignore syntax
|
||||||
patterns := []string{
|
patterns := []string{
|
||||||
|
Loading…
Reference in New Issue
Block a user