summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-08-11cli: add multipleStrings typeJakob Unterwurzacher
Will be used for --exclude.
2018-08-11tests: VerifyExistence: panic on inconsistent resultsJakob Unterwurzacher
In the past we did not check whether all methods of checking the file return the same result. We should.
2018-08-02travis ci: drop go 1.5 and go 1.6Jakob Unterwurzacher
Trying to build with these versions now throws this error: # golang.org/x/sys/unix ../../../golang.org/x/sys/unix/ioctl.go:18: undefined: runtime.KeepAlive It looks like x/sys/unix has dropped support for older Go versions.
2018-07-23fsck: print inode number on file read errorJakob Unterwurzacher
This makes it possible to find the file without mounting the fs.
2018-07-23configfile: drop superflous PrintfJakob Unterwurzacher
Before: $ gocryptfs -fsck . LoadConfFile: ReadFile: &os.PathError{Op:"open", Path:"/var/tmp/check-gocryptfs/scratchdev/gocryptfs.conf", Err:0xd} Cannot open config file: open /var/tmp/check-gocryptfs/scratchdev/gocryptfs.conf: permission denied After: $ gocryptfs -fsck . Cannot open config file: open /var/tmp/check-gocryptfs/scratchdev/gocryptfs.conf: permission denied
2018-07-22fusefronted: disallow writes running concurrently with readsJakob Unterwurzacher
As uncovered by xfstests generic/465, concurrent reads and writes could lead to this, doRead 3015532: corrupt block #1039: stupidgcm: message authentication failed, as the read could pick up a block that has not yet been completely written - write() is not atomic! Now writes take ContentLock exclusively, while reads take it shared, meaning that multiple reads can run in parallel with each other, but not with a write. This also simplifies the file header locking.
2018-07-15fusefrontend: doWrite: delete file header if first write failsJakob Unterwurzacher
xfstests generic/083 fills the filesystem almost completely while running fsstress in parallel. In fsck, these would show up: readFileID 2580: incomplete file, got 18 instead of 19 bytes This could happen when writing the file header works, but writing the actual data fails. Now we kill the header again by truncating the file to zero.
2018-07-15fusefrontend: doWrite: no need to take HeaderLock.RLock()Jakob Unterwurzacher
Other writers are blocked by ContentLock already.
2018-07-15WriteDirIV: delete incomplete gocryptfs.diriv file if write failsJakob Unterwurzacher
If the underlying filesystem is full, writing to gocryptfs.diriv may fail, and later fsck show this: OpenDir "xyz": could not read gocryptfs.diriv: wanted 16 bytes, got 0 Uncovered by xfstests generic/083. Also fixes a fd leak in the error path.
2018-07-15contentenc: reserve one extra block in pool plaintext buffersJakob Unterwurzacher
File holes and -fsck can cause unaligned read accesses, which means we have to decrypt one extra plaintext block. xfstests generic/083 manage to crash -fsck like this: generic/083 2018/07/14 15:25:21 wrong len=266240, want=131072 panic: wrong len=266240, want=131072 goroutine 1 [running]: log.Panicf(0x67fc00, 0x15, 0xc4204fec90, 0x2, 0x2) /usr/local/go/src/log/log.go:333 +0xda github.com/rfjakob/gocryptfs/internal/contentenc.(*bPool).Put(0xc4200d4800, 0xc4202f2000, 0x21000, 0x41000) /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/contentenc/bpool.go:27 +0x15d github.com/rfjakob/gocryptfs/internal/fusefrontend.(*File).doRead(0xc4200b4500, 0xc42019e000, 0x0, 0x20000, 0x28400, 0x20000, 0xc42019e000, 0xc4204ff008, 0x435164, 0xc420000180) /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/fusefrontend/file.go:227 +0xba9 github.com/rfjakob/gocryptfs/internal/fusefrontend.(*File).Read(0xc4200b4500, 0xc42019e000, 0x20000, 0x20000, 0x28400, 0x0, 0x0, 0x0) /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/fusefrontend/file.go:246 +0x23e main.(*fsckObj).file(0xc420069320, 0xc42001a630, 0x21) /home/jakob/go/src/github.com/rfjakob/gocryptfs/fsck.go:126 +0x21f main.(*fsckObj).dir(0xc420069320, 0xc420014dc0, 0x1d) /home/jakob/go/src/github.com/rfjakob/gocryptfs/fsck.go:76 +0x387 main.(*fsckObj).dir(0xc420069320, 0xc42021dae0, 0x19) /home/jakob/go/src/github.com/rfjakob/gocryptfs/fsck.go:74 +0x347
2018-07-15fsck: add debug output (enabled via -debug)Jakob Unterwurzacher
Turn the commented-out fmt.Printf into debug output via the tlog infrastructure.
2018-07-15file-format.md: list full block overheadrfjakob
For large files, the overhead will be 0.78125 %.
2018-07-14fusefrontend: log prealloc failures at Info levelJakob Unterwurzacher
If the underlying filesystem is full, it is normal get ENOSPC here. Log at Info level instead of Warning. Fixes xfstests generic/015 and generic/027, which complained about the extra output.
2018-07-08travis: run dep ensure in verbose modeJakob Unterwurzacher
But make the output fold to reduce clutter. Move wget to the install section, where output is folded by default.
2018-07-07MANPAGE: add proper description textJakob Unterwurzacher
We only had an "options" section which was mislabeled as "description". Add a proper description text.
2018-07-04README: it's not a mirrorJakob Unterwurzacher
2018-07-04README: call the Markdown source "mirror"Jakob Unterwurzacher
2018-07-04macos: fix O_DIRECT build failureJakob Unterwurzacher
O_DIRECT has no direct equivalent on MacOS (check out https://github.com/libuv/libuv/issues/1600 for details). Just define it to zero there.
2018-07-02README: mention O_DIRECT changeJakob Unterwurzacher
2018-07-02fusefrontend: disallow O_DIRECT and fall back to buffered IOJakob Unterwurzacher
O_DIRECT accesses must be aligned in both offset and length. Due to our crypto header, alignment will be off, even if userspace makes aligned accesses. Running xfstests generic/013 on ext4 used to trigger lots of EINVAL errors due to missing alignment. Just fall back to buffered IO.
2018-07-02fusefronted: downgrade fallocate message severityJakob Unterwurzacher
The message causes output mismatches in xfstests generic/112. Downgrade the severity to Info so it gets disabled when using "-q".
2018-07-01Fix golint warningsJakob Unterwurzacher
2018-07-01trezor: hide behind compile tagJakob Unterwurzacher
The trezor libraries are not yet stable enough to build gocryptfs with trezor support by default. It does not even compile at the moment: $ ./build.bash -tags enable_trezor # github.com/conejoninja/tesoro/vendor/github.com/trezor/usbhid ../../conejoninja/tesoro/vendor/github.com/trezor/usbhid/hid.go:32:11: fatal error: os/threads_posix.c: No such file or directory #include "os/threads_posix.c" ^~~~~~~~~~~~~~~~~~~~ compilation terminated. https://github.com/conejoninja/tesoro/issues/9
2018-07-01fsck: handle sparse files efficiently, fix xfstests generic/285Jakob Unterwurzacher
If we encounter a 128KB block of zeros, try to skip to the next data section by calling File.SeekData(). This fixes xfstests generic/285, which creates a 17TB sparse file, and runs fsck afterwards. Without this optimization, fsck would take ages.
2018-07-01fusefrontend: add File.SeekData() functionJakob Unterwurzacher
This function will enable "gocryptfs -fsck" to handle sparse files efficiently.
2018-07-01fusefrontend: export "File" typeJakob Unterwurzacher
"gocryptfs -fsck" will need access to helper functions, and to get that, it will need to cast a gofuse.File to a fusefrontend.File. Make fusefrontend.File exported to make this work.
2018-07-01fsck: get rid of channel read closuresJakob Unterwurzacher
Create proper functions instead to declutter the logic.
2018-07-01fsck: rename "CorruptItems" channel to "MitigatedCorruptions"Jakob Unterwurzacher
Make it clear that this channel is only used to report corruptions that are transparently mitigated and do not return an error to the user.
2018-07-01fsck: suppress "no problems found" when running quietJakob Unterwurzacher
Passing "-q" now disables the "fsck summary: no problems found\n" message.
2018-07-01main: improve fuse.NewServer error messageJakob Unterwurzacher
Before: fuse.NewServer failed: "fusermount exited with code 256\n" After: fuse.NewServer failed: fusermount exited with code 256
2018-07-01Only print masterkey once on -initJakob Unterwurzacher
It is no longer printed at all when mounting a filesystem, printing on -init can be disabled with -q. https://github.com/rfjakob/gocryptfs/issues/76
2018-07-01trezor: add sanity checks for decrypted valueJakob Unterwurzacher
Check that the value has changed, is not all-zero and has the right length.
2018-07-01Implemented the support of Trezor devices.Dmitry Yu Okunev
2018-07-01main: replace naked panic with log.PanicJakob Unterwurzacher
Fix the check that failed to find the case as well.
2018-07-01trezor: reject password change on Trezor-enabled fsJakob Unterwurzacher
This is not supported (yet? does it make sense?).
2018-07-01trezor: add TrezorPayloadJakob Unterwurzacher
TrezorPayload stores 32 random bytes used for unlocking the master key using a Trezor security module. The randomness makes sure that a unique unlock value is used for each gocryptfs filesystem.
2018-07-01configfile: reduce function name stutterJakob Unterwurzacher
configfile.LoadConfFile() -> configfile.Load() configfile.CreateConfFile() -> configfile.Create()
2018-07-01trezor: exit with usage error if used together with -extpassJakob Unterwurzacher
Using an external program for the Trezor PIN is not supported at the moment.
2018-07-01trezor: add basic "-init -trezor" testJakob Unterwurzacher
Verify that the Trezor feature flag is set after "-init -trezor".
2018-07-01trezor: add skeleton for Trezor supportJakob Unterwurzacher
readpassword.Trezor() is not implemented yet and returns a hardcoded dummy key.
2018-07-01README: Add folders side-by-side animation gifJakob Unterwurzacher
10 second animation that shows what gocryptfs does.
2018-06-24configfile: use tlog.ColorYellow instead of hardcoded color codeJakob Unterwurzacher
2018-06-19Fix three golint warningsJakob Unterwurzacher
We are clean again. Warnings were: internal/fusefrontend/fs.go:443:14: should omit type string from declaration of var cTarget; it will be inferred from the right-hand side internal/fusefrontend/xattr.go:26:1: comment on exported method FS.GetXAttr should be of the form "GetXAttr ..." internal/syscallcompat/sys_common.go:9:7: exported const PATH_MAX should have comment or be unexported
2018-06-12Update README and MANPAGE for v1.5v1.5Jakob Unterwurzacher
Also update the performance numbers. I see some slowdown, reason is not yet clear, but nothing to block the release.
2018-06-12dep: fix constraints and update dependenciesJakob Unterwurzacher
Gopkg.toml was emptied out by commit c3e12b5e68637 which seemed to work fine at the time. It turns out that, in absence of a branch = "master" constraint, dep will use the last tag. We want latest master, as this is what "go get" fetches, and hence what Travis uses for testing.
2018-06-12xattr: return EOPNOTSUPP instead of ENODATA in GetXattrJakob Unterwurzacher
Reading system.posix_acl_access and system.posix_acl_default should return EOPNOTSUPP to inform user-space that we do not support ACLs. xftestest essientially does chacl -l | grep "Operation not supported" to determine if the filesystem supports ACLs, and used to wrongly believe that gocryptfs does.
2018-06-08darwin does not have PATH_MAXJakob Unterwurzacher
Define our own, with the value from Linux.
2018-06-08main: cut down "flag provided but not defined" error messageJakob Unterwurzacher
Don't dump the help text on the unsuspecting user, but give a short error message: $ gocryptfs -foobar flag provided but not defined: -foobar Invalid command line: gocryptfs -foobar. Try 'gocryptfs -help'. For comparison: This is what cp does: $ cp --foo cp: unrecognized option '--foo' Try 'cp --help' for more information. And this what we used to do: $ gocryptfs -foobar flag provided but not defined: -foobar gocryptfs v1.4.4-45-gfb772da; go-fuse v20170619-35-gb16719c; 2018-06-08 go1.10.2 Usage: gocryptfs -init|-passwd|-info [OPTIONS] CIPHERDIR or gocryptfs [OPTIONS] CIPHERDIR MOUNTPOINT Common Options (use -hh to show all): -aessiv Use AES-SIV encryption (with -init) -allow_other Allow other users to access the mount -config Custom path to config file -ctlsock Create control socket at location -extpass Call external program to prompt for the password -fg Stay in the foreground -fusedebug Debug FUSE calls -h, -help This short help text -hh Long help text with all options -init Initialize encrypted directory -info Display information about encrypted directory -masterkey Mount with explicit master key instead of password -nonempty Allow mounting over non-empty directory -nosyslog Do not redirect log messages to syslog -passfile Read password from file -passwd Change password -plaintextnames Do not encrypt file names (with -init) -q, -quiet Silence informational messages -reverse Enable reverse mode -ro Mount read-only -speed Run crypto speed test -version Print version information -- Stop option parsing You passed: "-foobar" flag provided but not defined: -foobar
2018-06-07main: forkChild: try to read /proc/self/exeJakob Unterwurzacher
On Linux, where /proc exists, this makes sure that we are executing ourselves again, and not some other copy of the gocryptfs executable. This usually does not matter, but mount(1) unsets $PATH and sets argv[0] to just "gocryptfs".
2018-06-07Set a default PATH if PATH is empty or unsetJulian Orth
mount(1) unsets PATH before calling mount.fuse. Therefore it's not set in gocrpytfs either and daemonization fails if gocryptfs was not executed via an absolute path. mount.fuse handles this by leaving the execution of the helper to /bin/sh. /bin/sh handles an empty PATH by searching a few default locations. This patch sets the PATH to a sane default if it's empty or unset.