Commit Graph

1450 Commits

Author SHA1 Message Date
Jakob Unterwurzacher 7eba4f0788 tests: matrix: test -serialize_reads
Test if https://github.com/rfjakob/gocryptfs/pull/413 works
as intended.
2019-09-01 12:51:42 +02:00
Jakob Unterwurzacher f1b538ef24 Fix "constant 2435016766 overflows int32" build failure on arm
Cast to uint32 to fix the int32 overflow, and define BTRFS_SUPER_MAGIC
locally to fix the next failure on darwin.
2019-08-04 19:43:07 +02:00
Jakob Unterwurzacher b1d09b0f17 Rename isDirEmpty -> isEmptyDir
The function actually answers the question:
"is this an empty dir"?
2019-08-04 14:13:00 +02:00
Jakob Unterwurzacher 13055278f5 Force -noprealloc on Btrfs
Preallocation on Btrfs is broken ( https://github.com/rfjakob/gocryptfs/issues/395 ,
https://lore.kernel.org/linux-btrfs/CAPv9Zmk46As_P9Gyf_icET53xRda63h7iC1meES9xbdDEt9qow@mail.gmail.com/ )
and slow ( https://github.com/rfjakob/gocryptfs/issues/63 ).
2019-08-04 13:46:33 +02:00
dhirsbrunner abb2f1fad0 Prevent local user ID from appearing in source tarballs
The local user ID (1026 jakob) appears in the source tarballs gocryptfs_v1.7_src.tar.gz and gocryptfs_v1.7_src-deps.tar.gz as the owner of VERSION, Documentation, and vendor. This issue is already fixed for the binary releases by commit 07f57314af, and the solution here is the same: use "tar --owner=root --group=root".
2019-07-29 11:06:49 +02:00
Jakob Unterwurzacher b1468a732f Fix unix2syscall_darwin.go build failure
Error was

 +GOOS=darwin
 +GOARCH=amd64
 +go build -tags without_openssl
 # github.com/rfjakob/gocryptfs/internal/syscallcompat
 internal/syscallcompat/unix2syscall_darwin.go:22:32: u.Atimespec undefined (type unix.Stat_t has no field or method Atimespec)
 internal/syscallcompat/unix2syscall_darwin.go:23:32: u.Mtimespec undefined (type unix.Stat_t has no field or method Mtimespec)
 internal/syscallcompat/unix2syscall_darwin.go:24:32: u.Ctimespec undefined (type unix.Stat_t has no field or method Ctimespec)

caused by 87c872767d (diff-4913a9178621eadcdf191db17915fbcb)
2019-05-19 21:04:33 +02:00
Jakob Unterwurzacher 5888df9fbc dep: add go-gitignore 2019-05-19 21:04:06 +02:00
Jakob Unterwurzacher d915b791af Revert "travis: run tests with "-v""
1500 lines out output makes it hard to see where the
failure happends, especially on mobile. Drop the verbose
flag again.

This reverts commit 8cad0e2f4f.
2019-05-19 14:09:59 +02:00
Jakob Unterwurzacher 991adfc934 -passwd now takes a passed -scryptn flag into account
https://github.com/rfjakob/gocryptfs/issues/400
2019-05-13 23:01:44 +02:00
Jakob Unterwurzacher 2cb0e8a1ae gocryptfs -version: show architecture
Show the GOOS/GOARCH tuple as displayed by "go version".
2019-05-12 19:12:29 +02:00
Jakob Unterwurzacher cf99cfd401 travis: drop Go 1.7 and 1.8
Fails with

get "golang.org/x/crypto/scrypt": verifying non-authoritative meta tag
package math/bits: unrecognized import path "math/bits" (import path does not begin with hostname)

Other projects have dropped the old Go version for the same
reason, example: https://github.com/nmrshll/gphotos-uploader-cli/issues/7
2019-05-01 19:07:48 +02:00
Jakob Unterwurzacher ceff6833cf travis: add make root_test 2019-05-01 18:38:36 +02:00
Jakob Unterwurzacher 8d083e61f4 tests: root_test: also test file creation 2019-05-01 18:30:16 +02:00
Jakob Unterwurzacher e22c8ea0bd tests: fix root_test permission issues
The parent directories need execute all permissions.
2019-05-01 18:29:06 +02:00
Sebastian Lackner a97d14c42d syscallcompat: fetch supplementary groups for OpenatUser & friends
Handled the same way in GlusterFS, disorderfs, libfuse.
Fixes https://github.com/rfjakob/gocryptfs/issues/394
2019-05-01 17:52:07 +02:00
Jakob Unterwurzacher 96935e16b9 tests: add root_tests (tests that must run as root)
First test is a reproducer for
https://github.com/rfjakob/gocryptfs/issues/394 "Group permissions: No write access"
2019-05-01 13:12:44 +02:00
Jakob Unterwurzacher 3ac9872230 tests: split testParentDir by UID
When we run tests as root, they will leave root-owned files
in testParentDir, which causes trouble when we run tests as
a normal user later on. Split by UID.
2019-05-01 13:12:44 +02:00
Jakob Unterwurzacher 41dfbe67f8 test_helpers: better function comments for InitFS and Mount
It's confusing that you must pass "-extpass" for Mount but not
for InitFS. Note that in the comment.
2019-05-01 13:12:44 +02:00
Jakob Unterwurzacher dcd1068517 gocryptfs-xray: show full usage text on flag parse error 2019-05-01 13:12:44 +02:00
leilaes cc0a603ef8 Add CodeLingo Tenet to fix missing close file 2019-04-10 13:33:58 +02:00
Jakob Unterwurzacher 7d81494a64 fusefrontend: get rid of last hardcoded "gocryptfs.diriv" instances
Makes it easier to change the name (as some people want to):
https://github.com/rfjakob/gocryptfs/issues/37
2019-04-09 20:51:33 +02:00
Jakob Unterwurzacher 24036ab89f tests: speed up new tests a little
Before: ok  	github.com/rfjakob/gocryptfs/tests/matrix	18.560s
After:  ok  	github.com/rfjakob/gocryptfs/tests/matrix	13.425s
2019-04-08 20:34:24 +02:00
Jakob Unterwurzacher 8cad0e2f4f travis: run tests with "-v"
Let's log more details.

https://github.com/rfjakob/gocryptfs/issues/363
2019-04-08 20:27:13 +02:00
Jakob Unterwurzacher d851cf8055 tests: add TestConcurrentReadCreate, move to new file
https://github.com/rfjakob/gocryptfs/issues/363
2019-04-08 20:27:13 +02:00
Jakob Unterwurzacher d22ccf68b2 tests: add TestConcurrentReadWrite
Another attempt to find out what is going on behind
https://github.com/rfjakob/gocryptfs/issues/363
2019-04-08 20:27:13 +02:00
Jakob Unterwurzacher bde6387e2d travis: switch to xenial (ubuntu 16.04)
trusty (ubuntu 14.04) runs an ancient kernel (4.4)
2019-04-08 20:27:13 +02:00
Jakob Unterwurzacher 311c34af4b tests: add additional TestWrite10Tight test
Try to find out what goes wrong in
https://github.com/rfjakob/gocryptfs/issues/363
2019-04-08 20:27:13 +02:00
Jakob Unterwurzacher fe06e9f456 readpassword: delete CheckTrailingGarbage
CheckTrailingGarbage was called even when "-passfile" was
used, which is stupid, and causes false positives:

https://github.com/rfjakob/gocryptfs/issues/391
(false error "Received trailing garbage after the password"
when using -passfile in .bash_profile)

Instead of trying to improve the logic to handle that case
and make everything even more complicated, delete the function.

It is unclear if actually helps in some cases, and it definitely
harms as shown by the above bug report.
2019-04-08 20:18:45 +02:00
Jakob Unterwurzacher 8459bb15c1 configfile: fall back to sync() if fsync() fails
This can happen on network drives: FRITZ.NAS mounted on MacOS returns
"operation not supported": https://github.com/rfjakob/gocryptfs/issues/390
2019-04-08 19:54:54 +02:00
Jakob Unterwurzacher 7d1400d872 benchmark.bash: add support for go-fuse loopback
Make testing the performance of the new nodefs API easier

https://github.com/hanwen/go-fuse/pull/280
2019-03-31 21:19:07 +02:00
Jakob Unterwurzacher 3b18e546fc test.bash: pass flags on to "go vet"
Fixes this problem when openssl headers are not installed:

$ ./test-without-openssl.bash
gocryptfs v1.7-11-g8f2723b without_openssl; go-fuse v1.0.0-133-gcc423d1; 2019-03-31 go1.12.1
Package libcrypto was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcrypto.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcrypto' found
pkg-config: exit status 1
2019-03-31 15:16:20 +02:00
Jakob Unterwurzacher 8f2723b387 Allow "nofail" for /etc/fstab use 2019-03-31 14:33:02 +02:00
Jakob Unterwurzacher ec17445b99 forward mode: create gocryptfs.diriv files with 0440 permissions
Makes it easier to share an encrypted folder via a network drive.

https://github.com/rfjakob/gocryptfs/issues/387
2019-03-30 20:06:40 +01:00
Jakob Unterwurzacher a4f461a305 Changelog: add --exclude-wildcard 2019-03-30 19:50:49 +01:00
Jakob Unterwurzacher fba9b2b995 reverse: don't show gocryptfs.conf if a custom config path was passed
GetAttr checks for this, but OpenDir did not.

https://github.com/rfjakob/gocryptfs/issues/385
2019-03-26 20:59:52 +01:00
Eduardo M KALINOWSKI 3bc100aeb3 reverse mode: support wildcard exclude (--exclude-wildcard)
This adds support for gitignore-like wildcards and exclude patters in
reverse mode. It (somewhat) fixes #273: no regexp support, but the
syntax should be powerful enough to satisfy most needs.

Also, since adding a lot of --exclude options can be tedious, it adds
the --exclude-from option to read patterns from a file (or files).
2019-03-26 20:56:37 +01:00
Jakob Unterwurzacher 73f9e2374d Add brew version shield
https://github.com/rfjakob/gocryptfs/issues/382
2019-03-23 23:33:51 +01:00
Jakob Unterwurzacher 3ccb9f86a6 Update dependencies
We want this go-fuse commit
161a164844
as it fixes
https://github.com/rfjakob/gocryptfs/issues/274 and
https://github.com/rfjakob/gocryptfs/issues/375
2019-03-20 20:38:13 +01:00
Jakob Unterwurzacher 015cbc8195 gocryptfs-xray man page: I did mean gocryptfs-xray
...not gocryptfs here.

https://github.com/rfjakob/gocryptfs/pull/380
2019-03-18 21:22:35 +01:00
Jakob Unterwurzacher ae565b2291 Makefile: also install gocryptfs-xray man page 2019-03-18 08:27:24 +01:00
Maxim Baz ceb0862438 Add install goal in Makefile 2019-03-18 08:25:29 +01:00
Maxim Baz 1f37c920ac Add missing -ldflags for gocryptfs-xray 2019-03-18 08:21:53 +01:00
Jakob Unterwurzacher 8373959c95 Update changelog for v1.7 2019-03-17 16:59:11 +01:00
Jakob Unterwurzacher 5857521b40 Add contrib/statfs tool
This should help debugging

https://github.com/rfjakob/gocryptfs/issues/375 and
https://github.com/rfjakob/gocryptfs/issues/274 ,

as MacOS does not have "stat -f".
2019-03-17 12:48:44 +01:00
Jakob Unterwurzacher cd7a686211 tests: fix data race in TestDirIVRace
Ironically, the test for DirIV races had a data race itself
by writing to a bool without taking a lock.

Found by running "./test.bash -race":

WARNING: DATA RACE
Write at 0x00c00001dea5 by goroutine 22:
  github.com/rfjakob/gocryptfs/tests/defaults.TestDirIVRace.func1()
      /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/diriv_test.go:39 +0x38
  github.com/rfjakob/gocryptfs/tests/defaults.TestDirIVRace()
      /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/diriv_test.go:73 +0x65c
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:865 +0x163

Previous read at 0x00c00001dea5 by goroutine 23:
  github.com/rfjakob/gocryptfs/tests/defaults.TestDirIVRace.func2()
      /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/diriv_test.go:51 +0x8b

Goroutine 22 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:916 +0x699
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1157 +0xa8
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:865 +0x163
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1155 +0x523
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1072 +0x2eb
  github.com/rfjakob/gocryptfs/tests/defaults.TestMain()
      /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/main_test.go:21 +0xe1
  main.main()
      _testmain.go:76 +0x222

Goroutine 23 (running) created at:
  github.com/rfjakob/gocryptfs/tests/defaults.TestDirIVRace()
      /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/diriv_test.go:43 +0x48d
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:865 +0x163
==================
--- FAIL: TestDirIVRace (0.00s)
    testing.go:809: race detected during execution of test
FAIL
2019-03-03 14:09:33 +01:00
Jakob Unterwurzacher cf27037f20 Allow multiple -extpass arguments
To support arguments containing spaces, -extpass can now
be passed multiple times.

https://github.com/rfjakob/gocryptfs/issues/289
2019-03-03 13:25:30 +01:00
Jakob Unterwurzacher 61940a9c06 Include rendered man page in source tarballs
This gives users who build from the source tarball, but
do not want to install pandoc, access to the man pages.

Apperently the gocryptfs homebrew package ships without
the man pages at the moment to avoid pandoc.

Requested at
https://github.com/rfjakob/gocryptfs/issues/355
2019-03-02 15:43:58 +01:00
Jakob Unterwurzacher 60cae5063f Update deps
go-fuse now has a v1.0.0. release!
https://github.com/hanwen/go-fuse/releases/tag/v1.0.0
2019-03-02 14:45:28 +01:00
Jakob Unterwurzacher ddcc1fb3aa Go 1.12 dropped "go tool vet", use "go vet" instead
Also add Go 1.12 to Travis.
2019-03-02 14:39:03 +01:00
Jakob Unterwurzacher 173218895c tests: fix compile error in matrix_test.go
Error was:

tests/matrix/matrix_test.go:101:9: no new variables on left side of :=
2019-02-17 17:25:41 +01:00