Commit Graph

1212 Commits

Author SHA1 Message Date
Jakob Unterwurzacher
df28fc5a11 nametransform: get rid of leading "./"
Paths in the root directory were encrypted to this:

    foobar -> ./N9vPc0gXUY4PDSt0-muYXQ==
2016-11-09 23:41:47 +01:00
Jakob Unterwurzacher
df1e3a10c4 nametransform: nicer error message on empty gocryptfs.diriv
Old:

	Nov 06 13:34:38 brikett gocryptfs[16228]: ReadDirIVAt: Read failed: EOF
	Nov 06 13:34:38 brikett gocryptfs[16228]: go-fuse: can't convert error type: EOF

New:

	Nov 06 14:08:43 brikett gocryptfs[17361]: ReadDirIVAt: wanted 16 bytes, got 0. Returning EINVAL.
2016-11-06 14:09:34 +01:00
Jakob Unterwurzacher
d15122d3d6 Add Go 1.4 compatibility layer for raw64
Using raw64 will not work, but at least it will compile.
2016-11-01 19:25:59 +01:00
Jakob Unterwurzacher
f4c367381e main: fix comments that reference "-f" 2016-11-01 19:04:49 +01:00
Jakob Unterwurzacher
b527e205e2 main: rename "-f" to "-fg"
"-f" looks too much like "--force". The old variant is still
accepted for compatability.
2016-11-01 19:00:45 +01:00
Jakob Unterwurzacher
d6678f73b4 MANPAGE: document -raw64 2016-11-01 18:53:42 +01:00
Jakob Unterwurzacher
2b991c9743 Add support for unpadded base64 filenames, "-raw64"
Through base64.RawURLEncoding.

New command-line parameter "-raw64".
2016-11-01 18:43:22 +01:00
Jakob Unterwurzacher
964e0e6b36 tests: add raw64 tests
Also, use "%#v" instead of JSON for debug output.
This means we can unexport all fields.
2016-11-01 18:42:10 +01:00
Jakob Unterwurzacher
d41492bcbc MANPAGE: update version field description 2016-11-01 18:30:32 +01:00
Jakob Unterwurzacher
8ce735e987 main: print "args" slightly prettier 2016-11-01 18:30:00 +01:00
Jakob Unterwurzacher
75b776cb3d MANPAGE: add reverse example, move "-o" into alphabetical list
People will search for "-o" alphabetically, so put it into the
alphabetical option list, even if it is not a real option.
2016-11-01 15:55:05 +01:00
Jakob Unterwurzacher
e993fd5fbc packakge.bash: include rendered man page in tarball 2016-11-01 15:43:33 +01:00
Jakob Unterwurzacher
944eaf2fb5 fusefronted: expire dir IV cache after one second
The Back In Time backup tool (https://github.com/bit-team/backintime)
wants to write directly into the ciphertext dir.
This may cause the cached directory IV to become out-of-date.
Having an expiry time limits the inconstency to one second, like
attr_timeout does for the kernel getattr cache.
2016-11-01 10:57:39 +01:00
Jakob Unterwurzacher
a9c7565b80 fusefrontend: refactor dirIVCache
Simplify the code a bit.
2016-11-01 10:34:41 +01:00
Jakob Unterwurzacher
fd88dbd687 README: fix "15#" typo 2016-10-30 16:57:22 +01:00
Jakob Unterwurzacher
1a847b8f00 Update README for v1.1.1 2016-10-30 16:48:02 +01:00
Jakob Unterwurzacher
c2192cfcad fusefrontend: drop atime workarounds
The fix at https://github.com/hanwen/go-fuse/pull/131 has been merged.
Drop the workarounds and re-enable the tests.
2016-10-30 16:29:36 +01:00
Jakob Unterwurzacher
4e95d394cf build.bash: rename "GOPATH2" to "GOPATH1"
It's the 1st component of GOPATH, so call it like that.
2016-10-30 16:17:39 +01:00
Jakob Unterwurzacher
c7385b3681 build.bash: abort if we hit a known-bad go-fuse version
Also, standardize to "if [[ ]] ; then" style.
2016-10-30 16:17:00 +01:00
Jakob Unterwurzacher
85f1fd0b0f fusefronted: more concise corrupt block log message
Calculating the block offset is easy enough, even more now
that gocryptfs-xray exists.
2016-10-28 21:18:36 +02:00
Jakob Unterwurzacher
012152f3d1 fusefrontend: I/O error instead of panic on all-zero nonce
Running xfstests generic/075 on tmpfs often triggered a panic
for what seems to be a tmpfs bug.

Quoting from the email to lkml,
http://www.spinics.net/lists/kernel/msg2370127.html :

	tmpfs seems to be incorrectly returning 0-bytes when reading from
	a file that is concurrently being truncated.
2016-10-28 21:18:36 +02:00
Jakob Unterwurzacher
4cc64c2c95 main: redirect panics to /tmp/gocryptfs_panic.NNNN
Redirect stdout and stderr to /tmp/gocryptfs_paniclog.NNNNNN
instead of closing them so users have a chance to get the
backtrace on a panic.

This only applies if "-nosyslog" is NOT set. Panics will
go to terminal as usual if it is.
2016-10-28 21:18:36 +02:00
Jakob Unterwurzacher
a08d55f42d fusefronted: optimize NFS streaming writes by saving one Stat()
Stat() calls are expensive on NFS as they need a full network
round-trip. We detect when a write immediately follows the
last one and skip the Stat in this case because the write
cannot create a file hole.

On my (slow) NAS, this takes the write speed from 24MB/s to
41MB/s.
2016-10-28 21:17:53 +02:00
Jakob Unterwurzacher
9b7135224b tests: fetch the example tarball from cdn.kernel.org
www.kernel.org is painfully slow at times.
2016-10-25 23:13:44 +02:00
Jakob Unterwurzacher
d64ccf7cf4 fusefrontend: move hole padding check out of Write()
The details of the hole handling don't have to be in
Write, so move it away.
2016-10-25 22:37:45 +02:00
Jakob Unterwurzacher
6538dc15af fusefrontend: rename "createsHole" to clearer "createsCiphertextHole"
...and add comments for what is happening.
2016-10-25 21:19:37 +02:00
Jakob Unterwurzacher
f41d2e0676 Run cli_args_test.go through "gofmt -s" 2016-10-24 19:36:44 +02:00
rfjakob
8bed6e454e README: make badges not take vertical space 2016-10-24 19:35:13 +02:00
rfjakob
88598154c7 README: add Go report card badge 2016-10-24 19:30:39 +02:00
Jakob Unterwurzacher
aeda9721d0 Fix misspellings
Close https://github.com/rfjakob/gocryptfs/issues/54
2016-10-24 19:18:13 +02:00
Jakob Unterwurzacher
ab4de4cbcd README: note the name of the AESSIV feature flag. 2016-10-21 09:18:10 +02:00
Jakob Unterwurzacher
a74a7e7f54 configfile: add newline at the end
For convenience for the user, add a newline at the end.
Reported as #51 .
2016-10-21 08:43:39 +02:00
Jakob Unterwurzacher
86afaee200 MANPAGE: prettify plain-text formatting 2016-10-21 00:05:56 +02:00
Jakob Unterwurzacher
ceec46c1c1 Update README for v1.1 2016-10-19 22:49:57 +02:00
Jakob Unterwurzacher
1e66499af8 tests: add example tar 2016-10-19 22:32:21 +02:00
Jakob Unterwurzacher
77ebd62721 tests: fix forgotten variable rename 2016-10-19 22:31:03 +02:00
Jakob Unterwurzacher
589748548f tests: add 1980.tar.gz extract test
Test that we get the right timestamp when extracting a tarball.

Also simplify the workaround in doTestUtimesNano() and fix the
fact that it was running no test at all.
2016-10-19 22:25:54 +02:00
Jakob Unterwurzacher
600ceece35 lint fixes 2016-10-19 01:12:45 +02:00
Jakob Unterwurzacher
891a3b4c8a fusefrontend: Utimens: one more band-aid
Revert once https://github.com/hanwen/go-fuse/pull/131 is merged.
2016-10-16 20:20:00 +02:00
Jakob Unterwurzacher
4866785f4b tests: add test for -password -masterkey
Also, make the other password tests more rigorous by verifying the
fs content.
2016-10-16 19:13:00 +02:00
Jakob Unterwurzacher
c487e176bd main: allow password change with -masterkey
Requested at https://github.com/rfjakob/gocryptfs/issues/28
2016-10-16 18:17:28 +02:00
Jakob Unterwurzacher
ca3cc5eca3 tests: fix stdin password change test
It was actually testing extpass a second time.
2016-10-16 18:13:26 +02:00
Jakob Unterwurzacher
ec4a626316 main: catch "-extpass" AND "-masterkey" usage early
"The options -extpass and -masterkey cannot be used at the same time"
2016-10-16 16:50:23 +02:00
Jakob Unterwurzacher
b2d33028a6 readpassword: check extpass return code
...and exit if it is not zero.
2016-10-16 16:44:27 +02:00
Jakob Unterwurzacher
540f125f18 main: move masterkey warnings into parseMasterKey
This makes sure all callers of parseMasterKey warn the user.
At the moment there is only one, but another one will be added
soon for forcing a password change when only the master key is
known.
2016-10-16 16:20:11 +02:00
Jakob Unterwurzacher
5144470e3d fusefrontend: Utimens: ugly band-aid for nil pointer crash in go-fuse
Crash is described at https://github.com/rfjakob/gocryptfs/issues/48 .
Revert this once https://github.com/hanwen/go-fuse/pull/131 is merged.
2016-10-16 15:08:05 +02:00
Jakob Unterwurzacher
a36e29f77e tests: verify that UTIME_OMIT works
It currently does not and even causes a crash due to a bug in
go-fuse.

Also converts the test to table-based.
2016-10-16 15:08:00 +02:00
Jakob Unterwurzacher
e2c5632db8 tests: deduplicate UtimesNano testing code 2016-10-16 15:04:59 +02:00
Jakob Unterwurzacher
35219d0022 fusefrontend: log missing gocryptfs.diriv
This can happen during normal operation when the directory has
been deleted concurrently. But it can also mean that the
gocryptfs.diriv is missing due to an error, so log the event
at "info" level.
2016-10-16 15:04:59 +02:00
Jakob Unterwurzacher
57e8df990c tests: split "normal" tests into "cli" and "defaults"
Also fixes the failure to run the benchmarks do to the missing
gocryptfs.diriv.
2016-10-16 15:04:53 +02:00