aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse/node_helpers.go
AgeCommit message (Collapse)Author
6 daysreverse: don't follow symlinks when serving gocryptfs.confJakob Unterwurzacher
.gocryptfs.reverse.conf is passed through to gocryptfs.conf in the reverse view unencrypted. lookupConf, VirtualConfNode.Getattr and VirtualConfNode.Open accessed it via syscall.Stat/Open on the full path, following symlinks. Anybody with write access to the backing directory could replace it with a symlink to, for example, /etc/shadow and read the target in plaintext through the mount when gocryptfs runs as root. Add RootNode.openConf(), which opens the file relative to the backing dir with O_NOFOLLOW|O_NONBLOCK (O_NONBLOCK so a FIFO cannot hang us) and rejects anything that is not a regular file. Use it for all three. Add TestConfigSymlink as a regression test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-03-08make formatJakob Unterwurzacher
2026-02-10Fix issue with reverse mode and excluded virtual filesm4rc0d1
This fixes #686. Now the `gocryptfs.longname.*.name` are present and readable in the reverse mount, regardless of the complexity of the exclusion patterns. The main issue was a `cPath` instead of `dPath` for the exclude check in `fusefrontend_reverse/node_helpers.go`. Also added a check to avoid the exclusion of `gocryptfs.conf` in the root directory. The test run results are in line with the main branch. Fixes https://github.com/rfjakob/gocryptfs/issues/686
2025-07-08Fix all staticcheck errors in gocryptfs codebasecopilot-swe-agent[bot]
Co-authored-by: rfjakob <286847+rfjakob@users.noreply.github.com> Add staticcheck to test.bash for continuous static analysis Co-authored-by: rfjakob <286847+rfjakob@users.noreply.github.com> Fix nil pointer dereference in timesToTimespec function The previous fix for deprecated fuse.UtimeToTimespec caused a panic because unix.TimeToTimespec doesn't handle nil pointers. This fix properly handles nil pointers by using unix.UTIME_OMIT while still using the non-deprecated unix.TimeToTimespec function. Co-authored-by: rfjakob <286847+rfjakob@users.noreply.github.com> Undo SA6002 changes and add staticcheck ignore directive instead Co-authored-by: rfjakob <286847+rfjakob@users.noreply.github.com>
2025-01-18reverse: lookupDiriv: use deriveDirIV helperJakob Unterwurzacher
2024-08-23reverse: fix force_ownerJakob Unterwurzacher
Fixes https://github.com/rfjakob/gocryptfs/issues/809
2024-05-01reverse: use unique generation number for all nodesJakob Unterwurzacher
We used to present gocryptfs.longname.*.name files for hardlinked files as hardlinked to the kernel (same Node ID) which is wrong. Fix this by using a unique generation number for all nodes, which also fixes possible issues with inode reuse. Basically what 1bc1db620b061aabf59469a5eb4fb60e3e1701a3 did for forward mode with -sharedstorage. Fixes https://github.com/rfjakob/gocryptfs/issues/802
2021-08-23go mod: declare module version v2Jakob Unterwurzacher
Our git version is v2+ for some time now, but go.mod still declared v1. Hopefully making both match makes https://pkg.go.dev/github.com/rfjakob/gocryptfs/v2 work. All the import paths have been fixed like this: find . -name \*.go | xargs sed -i s%github.com/rfjakob/gocryptfs/%github.com/rfjakob/gocryptfs/v2/%
2021-08-20-deterministic-names: implement for reverse mode, tooJakob Unterwurzacher
2021-08-16reverse mode: implement -one-file-systemJakob Unterwurzacher
Fixes https://github.com/rfjakob/gocryptfs/issues/475
2020-08-15v2api/reverse: finish -excludeJakob Unterwurzacher
Tests pass now.
2020-08-15v2api/reverse: fix two fd leaksJakob Unterwurzacher
2020-08-09v2api/reverse: implement ReadJakob Unterwurzacher
2020-08-08v2api/reverse: implement ReadlinkJakob Unterwurzacher
2020-08-02v2api/reverse: implement Lookup for longnameJakob Unterwurzacher
2020-08-01v2api/reverse: implement ReaddirJakob Unterwurzacher
2020-08-01v2api/reverse: implement Lookup & GetattrJakob Unterwurzacher