| Age | Commit message (Collapse) | Author |
|
|
|
...and one typo.
|
|
Add the -sharedstorage flag to the mounts and make it more
severe by adjusting the I/O and file sizes to arbitrary unaligned
values.
It passes *most of the time*.
If it fails, it's like this, and the reason is that there is no
fcntl locks in the READ path yet.
gocryptfs/tests/cluster$ go test -run TestClusterConcurrentRW -v
=== RUN TestClusterConcurrentRW
doRead 2895433: corrupt block #0: cipher: message authentication failed
doRead 2895433: corrupt block #0: cipher: message authentication failed
doRead 2895433: corrupt block #0: cipher: message authentication failed
cluster_test.go:98: readThread iteration 9165: ReadAt failed: read /var/tmp/gocryptfs-test-parent-1026/3021427391/TestClusterConcurrentRW.366469887.mnt1/foo: input/output error
--- FAIL: TestClusterConcurrentRW (0.40s)
FAIL
exit status 1
FAIL github.com/rfjakob/gocryptfs/v2/tests/cluster 0.406s
|
|
|
|
|
|
Scary. But explains why TestConcurrentCreate fails.
gocryptfs/tests/cluster$ go test -run TestPoCTornWrite
--- FAIL: TestPoCTornWrite (0.00s)
poc_test.go:210: iteration 214: inconsistent block: d6d6d6d6d6d6d6d6d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1d1
FAIL
|
|
This fails right now:
1 jakob@brikett:~/go/src/github.com/rfjakob/gocryptfs/tests/cluster$ go test -run TestOpenTruncate -v
=== RUN TestOpenTruncate
cluster_test.go:235: POSIX compliance issue: non-exlusive create failed with err=file exists
doWrite 2898550: corrupt header: ParseHeader: header is all-zero. Header hexdump: 000000000000000000000000000000000000
cluster_test.go:240: iteration 1: WriteAt: write /var/tmp/gocryptfs-test-parent-1026/1896094179/TestOpenTruncate.4202105280.mnt2/foo: input/output error
--- FAIL: TestOpenTruncate (0.10s)
FAIL
exit status 1
FAIL github.com/rfjakob/gocryptfs/v2/tests/cluster 0.099s
1 jakob@brikett:~/go/src/github.com/rfjakob/gocryptfs/tests/cluster$ go test -run TestOpenTruncate -v
=== RUN TestOpenTruncate
cluster_test.go:235: POSIX compliance issue: non-exlusive create failed with err=file exists
doRead 2898565: corrupt block #0: cipher: message authentication failed
ino2898565 fh9: RMW read failed: errno=5
cluster_test.go:240: iteration 8: WriteAt: write /var/tmp/gocryptfs-test-parent-1026/652691834/TestOpenTruncate.281532388.mnt1/foo: input/output error
--- FAIL: TestOpenTruncate (0.09s)
FAIL
exit status 1
FAIL github.com/rfjakob/gocryptfs/v2/tests/cluster 0.095s
|
|
|
|
This exercises the byte-range locks we just added.
|
|
Multiple host writing to the same empty file at the same time
could have overwritten each other's newly created file header,
leading to data corruption.
Fix the race by placing a byte-range lock on the file when
creating the file header.
|
|
In reverse mode, a custom config file passed via -config that lives inside
CIPHERDIR was presented as an ordinary encrypted file in the encrypted view,
which is useless and confusing. By default the config is mapped to a virtual
gocryptfs.conf, but ConfigCustom skips that mapping, so an in-CIPHERDIR custom
config was neither mapped nor hidden.
Plumb the config path into the reverse RootNode and treat a custom config file
located inside CIPHERDIR as excluded in isExcludedPlain, hiding it from both
readdir and lookup. Also document the -config reverse-mode behaviour in
MANPAGE.md and add a regression test.
Fixes #1009
|
|
|
|
Freebsd-support: Change bash shebang to use /usr/bin/env
Freebsd-support: Fix go vet "undefined" fixes when running make ci
freebsd: stub xattr functions
/proc/PID/fd does not exist on freebsd.
freebsd-support: modify FchmodatNofollow for FreeBSD
FreeBSD supports the Fchmodat system call, with the AT_SYMLINK_NOFOLLOW
flag. FchmodatNofollow has been modified to use this system call and
flag.
freebsd-support: PR changes and fixes
* Functions in fusefrontend_reverse/node_xattr_freebsd.go have been
stubbed for now.
* asuser_freebsd.go updated to only run f() when context is nil;
otherwise log a warning and return an error.
* emulate.go build flags updated, and FreeBSD specific version added.
* sys_freebsd.go bug in Renameat2 with RENAME_EXCHANGE flag fixed.
FreeBSD does not support atomic file swapping, so this flag now
returns an error.
* unix2syscall and atime is identical between FreeBSD and Darwin,
updated filenames so Go will build the file for FreeBSD and Mac OS.
freebsd-support: Addressed more PR comments and fixed build tags
|
|
|
|
|
|
|
|
Also add tests that opening a symlink (using unix.O_PATH | unix.O_NOFOLLOW)
works.
https://github.com/rfjakob/gocryptfs/issues/993
|
|
Fails right now:
gocryptfs/tests/reverse$ go test -run TestXattrGetMountpoint
--- FAIL: TestXattrGetMountpoint (0.00s)
xattr_test.go:78: LGet: xattr.get /var/tmp/gocryptfs-test-parent-1026/3269496664/x.3903415542.mnt user.foo453465324: invalid argument
xattr_test.go:82: LList: err=<nil>
FAIL
testcases[0] = struct { plaintextnames bool; deterministic_names bool }{plaintextnames:false, deterministic_names:false} failed
exit status 1
FAIL github.com/rfjakob/gocryptfs/v2/tests/reverse 0.091s
|
|
been passed
Reported by @Tunoac, https://github.com/rfjakob/gocryptfs/issues/395#issuecomment-3828507487
|
|
$ staticcheck --version
staticcheck 2025.1.1 (0.6.1)
$ staticcheck ./...
contrib/findholes/holes/holes.go:179:2: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New(NewSource(seed)) to obtain a local random generator. (SA1019)
tests/defaults/acl_test.go:24:2: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New(NewSource(seed)) to obtain a local random generator. (SA1019)
tests/plaintextnames/file_holes_test.go:143:2: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New(NewSource(seed)) to obtain a local random generator. (SA1019)
|
|
tmpfs supports user xattrs since Linux 6.6 (anno 2023):
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2daf18a7884dc03d5164ab9c7dc3f2ea70638469
|
|
On my Fedora I used to get this failure:
--- FAIL: TestXattrList (0.00s)
xattr_test.go:52: wrong number of names, want=20 have=21
xattr_test.go:58: mismatch on attr "security.selinux": valA = "", valC = "xxxxxxxxyyyyyyyyyyyyyyyzzzzzzzzzzzzz"
First step is to print the actual value using xattr.LGet.
This improves the error message to this:
--- FAIL: TestXattrList (0.00s)
xattr_test.go:53: wrong number of names, want=20 have=21
xattr_test.go:59: mismatch on attr "security.selinux": valA = "", valC = "system_u:object_r:fusefs_t:s0\x00"
2nd step is to ignore "security." attribs as we have no control
over them.
|
|
Fixes https://github.com/rfjakob/gocryptfs/issues/827
|
|
--- FAIL: Test555Dir (0.00s)
dir_test.go:90: wrong mode. want 0555 have 0755
FAIL
TestMain: matrix[0] = matrix.testcaseMatrix{plaintextnames:false, openssl:"auto", aessiv:false, raw64:false, extraArgs:[]string(nil)} failed
FAIL github.com/rfjakob/gocryptfs/v2/tests/matrix 2.109s
https://github.com/rfjakob/gocryptfs/issues/964
|
|
Because the deletion happens asynchronously, a
previous iteration can delete the socket of the
next one.
|
|
Added testing for RENAME_EXCHANGE
https://github.com/rfjakob/gocryptfs/issues/914
|
|
Fails at the moment, as expected:
=== RUN TestDirSize
matrix_test.go:938: stat size is different from fstat size: pStat=80 pFstat=30
matrix_test.go:941: fstat size is different: pSt=30 cSt=80
matrix_test.go:938: stat size is different from fstat size: pStat=100 pFstat=50
matrix_test.go:941: fstat size is different: pSt=50 cSt=100
matrix_test.go:938: stat size is different from fstat size: pStat=120 pFstat=70
matrix_test.go:941: fstat size is different: pSt=70 cSt=120
matrix_test.go:938: stat size is different from fstat size: pStat=140 pFstat=90
matrix_test.go:941: fstat size is different: pSt=90 cSt=140
matrix_test.go:938: stat size is different from fstat size: pStat=160 pFstat=110
matrix_test.go:941: fstat size is different: pSt=110 cSt=160
https://github.com/rfjakob/gocryptfs/issues/951
|
|
|
|
|
|
|
|
|
|
|
|
Fixes https://github.com/rfjakob/gocryptfs/issues/930
|
|
Co-authored-by: rfjakob <286847+rfjakob@users.noreply.github.com>
Add staticcheck to test.bash for continuous static analysis
Co-authored-by: rfjakob <286847+rfjakob@users.noreply.github.com>
Fix nil pointer dereference in timesToTimespec function
The previous fix for deprecated fuse.UtimeToTimespec caused a panic
because unix.TimeToTimespec doesn't handle nil pointers. This fix
properly handles nil pointers by using unix.UTIME_OMIT while still
using the non-deprecated unix.TimeToTimespec function.
Co-authored-by: rfjakob <286847+rfjakob@users.noreply.github.com>
Undo SA6002 changes and add staticcheck ignore directive instead
Co-authored-by: rfjakob <286847+rfjakob@users.noreply.github.com>
|
|
Tool-assisted.
|
|
|
|
|
|
|
|
Will be used soon in a new gitignore test.
Relates-to: https://github.com/rfjakob/gocryptfs/issues/927
|
|
$ make root_test
[...]
=== RUN TestRootForceOwner
root_test.go:398: mkdir /var/tmp/gocryptfs-test-parent-0/3816769547/TestRootForceOwner.2366169656.mnt/dir1: permission denied
root_test.go:408: open /var/tmp/gocryptfs-test-parent-0/3816769547/TestRootForceOwner.2366169656.mnt/file1: permission denied
root_test.go:415: mknod: permission denied
--- FAIL: TestRootForceOwner (0.04s)
https://github.com/rfjakob/gocryptfs/issues/783
|
|
Without this message, fsstress-gocryptfs.bash seems to just hang after Ctrl-C.
|
|
Error was:
+ go test -c -tags without_openssl -o /dev/null github.com/rfjakob/gocryptfs/v2/tests/defaults
Error: tests/defaults/main_test.go:532:17: undefined: unix.Getdents
Error: tests/defaults/main_test.go:538:16: undefined: unix.Getdents
Error: tests/defaults/main_test.go:549:16: undefined: unix.Getdents
|
|
Acc. to the commit message,
https://github.com/hanwen/go-fuse/commit/0d1228a39dd49c83c8b7c30dec7928f5d7d84cc0
break seeking in directories. This commit appears in go-fuse v2.6.0.
|
|
|
|
The days of GOPATH are over. Also, use the fsstress path
that "sudo make install" in xfstests uses per default.
|
|
|
|
Because if we have them in git, we get this:
$ go install github.com/rfjakob/gocryptfs/v2@latest
go: downloading github.com/rfjakob/gocryptfs/v2 v2.5.2
go: github.com/rfjakob/gocryptfs/v2@latest: create zip: tests/fsck/malleable_base64/27AG8t-XZH7G9ou2OSD_z
g: malformed file path "tests/fsck/malleable_base64/27AG8t-XZH7G9ou2OSD_z\ng": invalid char '\n'
g: malformed file path "tests/fsck/malleable_base64/27AG8t-XZH7G9ou2OSD_z\rg": invalid char '\r'
Fixes: https://github.com/rfjakob/gocryptfs/issues/904
Relates-to: https://github.com/golang/go/issues/28001
|
|
|
|
Both work with
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
but break with
golang.org/x/sys v0.30.0
https://github.com/rfjakob/gocryptfs/issues/893
https://github.com/rfjakob/gocryptfs/issues/892
|
|
I will add more tests for https://github.com/rfjakob/gocryptfs/issues/893
soon, these will also use DefaultPlainDir.
|