summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-08-20-deterministic-names: implement for reverse mode, tooJakob Unterwurzacher
2021-08-20MANPAGE: move nosyslog to MOUNT OPTIONS sectionJakob Unterwurzacher
It was in INIT OPTIONS by mistake.
2021-08-20-deterministic-names: accept flag on -initJakob Unterwurzacher
And store it in gocryptfs.conf (=remove DirIV feature flag).
2021-08-20Implement -deterministic-names: extended -zerodirivJakob Unterwurzacher
-deterministc-names uses all-zero dirivs but does not write them to disk anymore.
2021-08-19Flag -zerodiriv to create all diriv as all zero byte filesJose M Perez
2021-08-19syscallcompat: use early return in asUser()Jakob Unterwurzacher
2021-08-19golangci-lint: fix issues found by "unused" and "deadcode"Jakob Unterwurzacher
Except xattrSupported, this is a false positive. $ golangci-lint run --disable-all --enable unused --enable deadcode gocryptfs-xray/xray_main.go:24:5: `GitVersionFuse` is unused (deadcode) var GitVersionFuse = "[GitVersionFuse not set - please compile using ./build.bash]" ^ tests/symlink_race/main.go:47:6: `chmodLoop` is unused (deadcode) func chmodLoop() { ^ internal/readpassword/extpass_test.go:11:5: `testPw` is unused (deadcode) var testPw = []byte("test") ^ tests/reverse/xattr_test.go:13:6: func `xattrSupported` is unused (unused) func xattrSupported(path string) bool { ^ internal/fusefrontend_reverse/rpath.go:20:22: func `(*RootNode).abs` is unused (unused) func (rfs *RootNode) abs(relPath string, err error) (string, error) { ^ tests/matrix/matrix_test.go:310:6: `sContains` is unused (deadcode) func sContains(haystack []string, needle string) bool {
2021-08-19test_helpers: actually use global testParentDir variableJakob Unterwurzacher
Typo inside doInit.
2021-08-19fsck: sort files alphabetically againJakob Unterwurzacher
This makes fsck runs deterministic again. Sorting (commit quoted below) got lost while moving to go-fuse v2 api. commit e6caf56ea4ab10e747aa5dfc0a768cb8176ebe6a Author: Jakob Unterwurzacher <jakobunt@gmail.com> Date: Mon Apr 2 16:56:29 2018 +0200 fsck: sort files alphabetically This makes fsck runs deterministic.
2021-08-19Fix issues found by "go vet"Jakob Unterwurzacher
Issues were: # github.com/rfjakob/gocryptfs/contrib/findholes/holes contrib/findholes/holes/holes.go:136:2: unreachable code # github.com/rfjakob/gocryptfs/tests/root_test_test tests/root_test/root_test.go:139:2: unreachable code Also make sure we actually run "go vet" against the whole codebase.
2021-08-19golangci-lint: fix issues found by gosimpleJakob Unterwurzacher
Everything except the if err2.Err == syscall.EOPNOTSUPP case. Gets too confusing when collapsed into a single line. Issues were: $ golangci-lint run --disable-all --enable gosimple mount.go:473:2: S1008: should use 'return strings.HasPrefix(v, "fusermount version")' instead of 'if strings.HasPrefix(v, "fusermount version") { return true }; return false' (gosimple) if strings.HasPrefix(v, "fusermount version") { ^ cli_args.go:258:5: S1002: should omit comparison to bool constant, can be simplified to `args.forcedecode` (gosimple) if args.forcedecode == true { ^ cli_args.go:263:6: S1002: should omit comparison to bool constant, can be simplified to `args.aessiv` (gosimple) if args.aessiv == true { ^ cli_args.go:267:6: S1002: should omit comparison to bool constant, can be simplified to `args.reverse` (gosimple) if args.reverse == true { ^ internal/stupidgcm/stupidgcm.go:227:6: S1002: should omit comparison to bool constant, can be simplified to `g.forceDecode` (gosimple) if g.forceDecode == true { ^ gocryptfs-xray/xray_tests/xray_test.go:23:5: S1004: should use !bytes.Equal(out, expected) instead (gosimple) if bytes.Compare(out, expected) != 0 { ^ gocryptfs-xray/xray_tests/xray_test.go:40:5: S1004: should use !bytes.Equal(out, expected) instead (gosimple) if bytes.Compare(out, expected) != 0 { ^ gocryptfs-xray/paths_ctlsock.go:34:20: S1002: should omit comparison to bool constant, can be simplified to `!eof` (gosimple) for eof := false; eof == false; line++ { ^ tests/reverse/xattr_test.go:19:2: S1008: should use 'return err2.Err != syscall.EOPNOTSUPP' instead of 'if err2.Err == syscall.EOPNOTSUPP { return false }; return true' (gosimple) if err2.Err == syscall.EOPNOTSUPP { ^ internal/fusefrontend/node.go:459:45: S1002: should omit comparison to bool constant, can be simplified to `!nameFileAlreadyThere` (gosimple) if nametransform.IsLongContent(cName2) && nameFileAlreadyThere == false { ^ tests/xattr/xattr_integration_test.go:221:2: S1008: should use 'return err2.Err != syscall.EOPNOTSUPP' instead of 'if err2.Err == syscall.EOPNOTSUPP { return false }; return true' (gosimple) if err2.Err == syscall.EOPNOTSUPP { ^ tests/test_helpers/helpers.go:338:19: S1002: should omit comparison to bool constant, can be simplified to `open` (gosimple) if err != nil && open == true { ^ tests/matrix/concurrency_test.go:121:7: S1004: should use !bytes.Equal(buf, content) instead (gosimple) if bytes.Compare(buf, content) != 0 { ^
2021-08-19tlog: switch from golang.org/x/crypto/ssh/terminal to golang.org/x/termJakob Unterwurzacher
$ golangci-lint run internal/tlog/log.go:13:2: SA1019: package golang.org/x/crypto/ssh/terminal is deprecated: this package moved to golang.org/x/term. (staticcheck) "golang.org/x/crypto/ssh/terminal"
2021-08-18README: update for v2.1 releasev2.1Jakob Unterwurzacher
2021-08-18Drop workarounds for Go 1.11 and Go 1.12Jakob Unterwurzacher
2021-08-18github ci: drop Go 1.11Jakob Unterwurzacher
Contemporary x/sys/unix does not compile anymore with Go 1.11: https://github.com/rfjakob/gocryptfs/runs/3362218517?check_suite_focus=true + GOOS=darwin + GOARCH=amd64 + go build -tags without_openssl -o /dev/null Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20210817190340-bfb29a6856f2/unix/fcntl_darwin.go:11:9: undefined: fcntl Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20210817190340-bfb29a6856f2/unix/fcntl_darwin.go:16:12: undefined: fcntl Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20210817190340-bfb29a6856f2/unix/fcntl_darwin.go:22:12: undefined: fcntl Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20210817190340-bfb29a6856f2/unix/ioctl.go:21:9: undefined: ioctl Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20210817190340-bfb29a6856f2/unix/ioctl.go:30:9: undefined: ioctl Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20210817190340-bfb29a6856f2/unix/ioctl.go:39:9: undefined: ioctl Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20210817190340-bfb29a6856f2/unix/ioctl.go:49:9: undefined: ioctl Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20210817190340-bfb29a6856f2/unix/ioctl.go:61:9: undefined: ioctl Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20210817190340-bfb29a6856f2/unix/syscall_bsd.go:646:10: undefined: mmap Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20210817190340-bfb29a6856f2/unix/syscall_bsd.go:647:10: undefined: munmap Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20210817190340-bfb29a6856f2/unix/ioctl.go:61:9: too many errors note: module requires Go 1.17make: *** [Makefile:44: ci] Error 2 Error: Process completed with exit code 2.
2021-08-18Update dependenciesJakob Unterwurzacher
Using go get -u go mod tidy
2021-08-18README: update changelogJakob Unterwurzacher
2021-08-18Fix issues found by ineffassignJakob Unterwurzacher
gocryptfs$ ineffassign ./... /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/configfile/config_file.go:243:2: ineffectual assignment to scryptHash /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/configfile/config_file.go:272:2: ineffectual assignment to scryptHash /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/fusefrontend/file.go:285:3: ineffectual assignment to fileID /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/fusefrontend/node.go:367:3: ineffectual assignment to err /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/fusefrontend/node_open_create.go:68:2: ineffectual assignment to fd /home/jakob/go/src/github.com/rfjakob/gocryptfs/mount.go:308:2: ineffectual assignment to masterkey /home/jakob/go/src/github.com/rfjakob/gocryptfs/gocryptfs-xray/xray_main.go:156:13: ineffectual assignment to err /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/fusefrontend/prepare_syscall_test.go:65:16: ineffectual assignment to errno /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/syscallcompat/open_nofollow_test.go:34:2: ineffectual assignment to fd /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/acl_test.go:111:6: ineffectual assignment to err /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/acl_test.go:181:2: ineffectual assignment to sz /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/acl_test.go:198:2: ineffectual assignment to sz /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/main_test.go:365:8: ineffectual assignment to err /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/xattr/xattr_fd_test.go:30:6: ineffectual assignment to err /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/xattr/xattr_fd_test.go:66:6: ineffectual assignment to err
2021-08-18MANPAGE: add "exclude all but" exampleJakob Unterwurzacher
Fixes https://github.com/rfjakob/gocryptfs/issues/588
2021-08-18reverse: fix "exclude all but" caseJakob Unterwurzacher
With test. Fixes https://github.com/rfjakob/gocryptfs/issues/588
2021-08-18tests/reverse/TestExcludeTestFs: test trailing slashJakob Unterwurzacher
2021-08-18tests/reverse/TestExcludeTestFs: improve comments & code styleJakob Unterwurzacher
No functional changes.
2021-08-18MANPAGE: -ew: make gitignore syntax more prominentJakob Unterwurzacher
https://github.com/rfjakob/gocryptfs/issues/588
2021-08-17tests/cli/TestBadname: make sure case 5 is never decodableJakob Unterwurzacher
Sometimes, by chance, case 5 resulted in valid decrypted data: --- FAIL: TestBadname (0.08s) cli_test.go:885: Case 5 failed: "J7Rbo1BvfXojpBEr0Qrt_invalid_file GOCRYPTFS_BAD_NAME" in ["file GOCRYPTFS_BAD_NAME,\x9e$O\xc3j\x8c\xd0\x06\x01#\f%k\x02\xcanvalid_file GOCRYPTFS_BAD_NAME,mzaZRF9_0IU-_5vv2wPC_invalid_file GOCRYPTFS_BAD_NAME,file,file_invalid_file GOCRYPTFS_BAD_NAME,mzaZRF9_0IU-_5vv2wP_invalid_file GOCRYPTFS_BAD_NAME"] Add percent signs so base64 decoding always fails. Fixes https://github.com/rfjakob/gocryptfs/runs/3347883728
2021-08-17github actions ci: test different Go versionsJakob Unterwurzacher
2021-08-16tests/reverse: replace os.ReadDir to support older Go versionsJakob Unterwurzacher
2021-08-16tests/root_test: show failing command detailJakob Unterwurzacher
https://github.com/kdave/btrfs-progs/issues/392
2021-08-16reverse mode: implement -one-file-systemJakob Unterwurzacher
Fixes https://github.com/rfjakob/gocryptfs/issues/475
2021-08-16tests/cli: escape filenames in TestBadname logsJakob Unterwurzacher
I just got this message (not reproducible) with unescaped binary garbage. UnmountErr: "/var/tmp/gocryptfs-test-parent-1026/114471933/TestMountBackground.899727687.mnt" was not found in MountInfo, cannot check for FD leaks UnmountErr: "/var/tmp/gocryptfs-test-parent-1026/114471933/TestConfigPipe.212912444.mnt" was not found in MountInfo, cannot check for FD leaks DecryptName "mzaZRF9_0IU-_5vv2wPC_i": unPad16 error: Padding too long, padLen=49 > 16 OpenDir ".": invalid entry "KqQ346cuOAFHv_qSta5PhAwrongPattern": bad message DecryptName "mzaZRF9_0IU-_5vv2wP_in": unPad16 error: Padding byte at i=10 is invalid --- FAIL: TestBadname (0.11s) cli_test.go:885: Case 5 failed: 'KqQ346cuOAFHv_qSta5P_invalid_file GOCRYPTFS_BAD_NAME' in [file_invalid_file GOCRYPTFS_BAD_NAME,file,mzaZRF9_0IU-_5vv2wPC_invalid_file GOCRYPTFS_BAD_NAME,file GOCRYPTFS_BAD_NAME,�*A���y���Gfnvalid_file GOCRYPTFS_BAD_NAME,mzaZRF9_0IU-_5vv2wP_invalid_file GOCRYPTFS_BAD_NAME] Invalid cipherdir: directory /var/tmp/gocryptfs-test-parent-1026/114471933/TestInitNotEmpty not empty FAIL FAIL github.com/rfjakob/gocryptfs/tests/cli 4.817s
2021-08-16inomap: update outdated wording in commentsJakob Unterwurzacher
2021-08-16inomap: warn on first use of spillMapJakob Unterwurzacher
We normally should not need it, warn if we do. As the tests run with -wpanic, we would catch it.
2021-08-13Makefile: add uninstall targetJakob Unterwurzacher
2021-08-12main: accept magic /dev/fd/ mountpointJakob Unterwurzacher
https://github.com/rfjakob/gocryptfs/issues/590
2021-08-11syscallcompat: use BTRFS_SUPER_MAGIC from unix libJakob Unterwurzacher
2021-08-11Makefile: don't ever run "git clean -dxff"Jakob Unterwurzacher
"make ci" almost made me lose the new quirks files. Let's not do that anymore.
2021-08-11syscallcompat: move quirks logic here & fix darwinJakob Unterwurzacher
We need to look at f_fstypename acc. to https://stackoverflow.com/a/52299141/1380267 : > As filesystem type numbers are now assigned at runtime in > recent versions of MacOS, you must use f_fstypename to > determine the type. https://github.com/rfjakob/gocryptfs/issues/585
2021-08-10main: add testcases for convertToDoubleDash & parseCliOptsJakob Unterwurzacher
2021-08-10main: take advantage of pflag slice typesJakob Unterwurzacher
Our multipleStrings type is now built in.
2021-08-10main: show specific error on command line parse failureJakob Unterwurzacher
2021-08-10main: autoformat import blockJakob Unterwurzacher
The autoformatter now always wants to move the ensurefds012 import into the import block. Accept it and fix the spelling of "alphabetically".
2021-08-10main: switch from flag to pflagJakob Unterwurzacher
Need support for flags at any position for https://github.com/rfjakob/gocryptfs/issues/590
2021-08-10main: push TestPrefixOArgs testcase struct into TestPrefixOArgsJakob Unterwurzacher
No need to have it declared globally.
2021-08-02fusefrontend: add quirks for MacOS ExFATJakob Unterwurzacher
This also moves the quirks logic into fusefrontend. Fixes https://github.com/rfjakob/gocryptfs/issues/585
2021-08-02go mod: upgrade go-fuseJakob Unterwurzacher
Let's not crash anymore when we see inode number 1 ( https://github.com/hanwen/go-fuse/commit/0aaef6dde4b62dd0f21d545c5001d9e5ece0c87e ) https://github.com/rfjakob/gocryptfs/issues/585
2021-07-31README: Update ChangelogJakob Unterwurzacher
2021-07-31fusefrontend: -sharedstorage: present stable inode numbersJakob Unterwurzacher
Use the Gen field (inode generation) to distinguish hard links while passing the real inode numbers to userspace. Fixes https://github.com/rfjakob/gocryptfs/issues/584
2021-07-31tests: matrix: add TestPwdJakob Unterwurzacher
https://github.com/rfjakob/gocryptfs/issues/584
2021-07-31fusefrontend: prepareAtSyscall: handle error when opening ourselvesJakob Unterwurzacher
Error handling was missing here, so we would later get confusing EBADF errors due to dirfd being -1.
2021-07-29fusefrontend: implement fsync on directoriesJakob Unterwurzacher
Fixes https://github.com/rfjakob/gocryptfs/issues/587
2021-07-29fido2: actually drop `-v` flagJakob Unterwurzacher
Commit 2a9d70d48f4cc715a6864849cdec91ab08b6fd03 only dropped the flag on mount but not on `-init`. Also drop it on `-init`. Fixes https://github.com/rfjakob/gocryptfs/issues/571 (part II)