Commit Graph

1782 Commits

Author SHA1 Message Date
Jakob Unterwurzacher 7e9e63b430 contrib/statvsfstat: add statvsfstat tool
Cli tool to compare the result of Stat() and Fstat().
2019-11-16 21:19:08 +01:00
Jakob Unterwurzacher f7ddae24ed tests: fsstress: clean up leftover mounts on startup
Broken mounts may accumulate when the fs crashes.
2019-11-10 22:06:40 +01:00
Jakob Unterwurzacher d404dcd3e3 tests: drop "-l" flag from fsstress-loopback.bash
No longer supported by go-fuse loopback.
2019-11-10 20:59:07 +01:00
Jakob Unterwurzacher e4148028af fusefrontend: warn about missing diriv
The comment is outdated, at this point, we should
really not get any errors from ReadDirIVAt.

The change is best seen when running the fsck tests. Before:

  fsck: error opening dir "missing_diriv": 2=no such file or directory

After:

  OpenDir "K2m0E6qzIfoLkVZJanoUiQ": could not read gocryptfs.diriv: no such file or directory
  fsck: error opening dir "missing_diriv": 5=input/output error

See https://github.com/rfjakob/gocryptfs/issues/403 , where
the extra info would have been helpful.
2019-11-03 20:38:15 +01:00
Jakob Unterwurzacher 3b67bc5711 main: show "-fsck" in help text
Suggested at https://github.com/rfjakob/gocryptfs/issues/403
2019-11-03 20:19:22 +01:00
Jakob Unterwurzacher 93939961f5 fusefrontend: don't return EIO on directory with corrupt file names
This was meant as a way to inform the user that
something is very wrong, however, users are hitting
the condition on MacOS due to ".DS_Store" files, and
also on NFS due to ".nfsXXX" files.

Drop the whole thing as it seems to cause more pain
than gain.

Fixes https://github.com/rfjakob/gocryptfs/issues/431
2019-11-03 20:12:05 +01:00
Jakob Unterwurzacher 74b723d765 tests: send SIGUSR1 to loopback
loopback needs to receive SIGUSR1 to write a memory profile.
2019-11-03 20:04:23 +01:00
Jakob Unterwurzacher 6c91f697e1 tests: make extractloop work with go-fuse loopback again
The "-l" flag is no longer supported in go-fuse loopback, drop
it.
2019-10-19 19:58:39 +02:00
Jakob Unterwurzacher 03fdfc4c90 Update performance.txt 2019-10-13 19:55:06 +02:00
Jakob Unterwurzacher 26f9f8ff72 Update fuse-xfstests results 2019-10-13 19:34:03 +02:00
Jakob Unterwurzacher 8cb104f004 Update README for v1.7.1 2019-10-06 22:35:27 +02:00
Jakob Unterwurzacher 65bc006a78 stress_tests: use /var/tmp by default
There is a good chance that /tmp is tmpfs, and we want to
run our tests on a real filesystem.
2019-10-06 22:34:19 +02:00
Jakob Unterwurzacher a1f6477401 test.bash: export TMPDIR
We have to export TMPDIR, otherwise the Go tests to
not pick it up.
2019-10-06 21:56:01 +02:00
Jakob Unterwurzacher f9f3c6ac5c travis: also test Go 1.12.x 2019-10-06 21:53:50 +02:00
Jakob Unterwurzacher 8c44294087 tests: use /var/tmp by default
On Fedora, /tmp is tmpfs, which behaves differently than ext4
(inode numbers are never reused, for example).

Use /var/tmp, which is ext4 on Fedora, to get a more realistic
test environment.

This also allows us to drop the xattr workaround.
2019-10-06 21:53:20 +02:00
Jakob Unterwurzacher 00af4f4864 fusefrontend: unregister from openfiletable before closing the fd
Closing the fd means the inode number may be reused immediately
by a new file, so we have to get the old fileID out of the table
beforehand!

Hopefully fixes https://github.com/rfjakob/gocryptfs/issues/363
2019-10-06 21:47:36 +02:00
Jakob Unterwurzacher 43265940fa fusefrontend: print file hexdump on header error
This should help debugging https://github.com/rfjakob/gocryptfs/issues/363 ,
but does no harm in normal operation as it only prints ciphertext to the log.
2019-10-06 19:37:51 +02:00
Jakob Unterwurzacher b3c88f573f contentenc: add explicit test for all-zero header
https://github.com/rfjakob/gocryptfs/issues/363
2019-10-06 19:37:51 +02:00
Jakob Unterwurzacher 1fb18f4a9e tests: filter leaked fds by prefix
When running

  $ go test ./tests/matrix/

in isolation, it failed like this:

  fd leak? before, after:
  [0r=/dev/null 3w=/dev/null 5r=/proc/8078/fd (hidden:4)]
  [0r=/dev/null 3w=/dev/null 5w=/tmp/go-build366655199/b001/testlog.txt 7r=/proc/8078/fd (hidden:4)]

Filter by prefix to get rid of this spurious test failure.
2019-10-06 19:37:51 +02:00
Jakob Unterwurzacher d361f6e35b tests: clarify which process seems to be leaking fds
The tests check if they leak fds themselves, but we also
check if gocryptfs leaks fds. Clarify what is what in the
error message.
2019-10-06 18:48:09 +02:00
Jakob Unterwurzacher 44e5c9ab96 benchmark.bash: drop hardcoded encfs path 2019-09-21 19:25:50 +02:00
Tonimir Kisasondi df37318fba Update readme.md
Just added a note to preinstall fuse, so the standalone
binary will work without problem.
2019-09-08 23:10:40 +02:00
Jakob Unterwurzacher 56eb85651b serialize_reads: drop superflous "continue"
Found while debugging https://github.com/rfjakob/gocryptfs/pull/413
2019-09-08 21:19:44 +02:00
Jakob Unterwurzacher 6df76db22b Update README 2019-09-08 16:31:14 +02:00
Jakob Unterwurzacher 0a4db7d9e9 Fix -idle unmounting despite activity
Fixes https://github.com/rfjakob/gocryptfs/issues/421
2019-09-08 16:29:20 +02:00
Jakob Unterwurzacher ce13851bbf tests: add TestNotIdle
Mount with idle timeout of 100ms read something every 10ms. The fs should
NOT get unmounted. Regression test for https://github.com/rfjakob/gocryptfs/issues/421
2019-09-08 16:16:18 +02:00
Jakob Unterwurzacher ea634090dc test_helpers: ListFds: handle an exited process gracefully
This used to dump a backtrace to the console which obscured what
is going on.
2019-09-08 16:15:35 +02:00
Jakob Unterwurzacher ed230379e7 Expand statfs man page a little and include in build.bash 2019-09-08 15:50:05 +02:00
Felix Lechner 92ae62f9cc Provide a manpage for statfs tool. 2019-09-08 15:30:29 +02:00
Felix Lechner 372e0333b3 Fix 'cannot adjust line' warning from man in gocryptfs manpage.
When generating man pages, pandoc marks indented code blocks with the
roff macro '.nf'. That avoids a warning from man related to the long
line about the master key.
2019-09-07 14:20:55 +02:00
Felix Lechner 76969e5992 Fix a typo in gocryptfs manpage. 2019-09-07 14:13:29 +02:00
Shubham Chaudhary 3e9b73d925 Add installation instructions in README.md 2019-09-01 12:57:23 +02:00
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