| Age | Commit message (Collapse) | Author |
|
.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>
|
|
Fixes https://github.com/rfjakob/gocryptfs/issues/809
|
|
|
|
Unlike the FUSE implementation on Linux, macFUSE doesn't cache the file
attributes from the `LOOKUP` call, so it calls `GETATTR` prior to
accessing a file.
In the case of the `VirtualConfNode` (reverse config file passthrough),
this resulted in the default `GETATTR` implementation returning an empty
result, ultimately resulting in a "permission denied" error.
14:44:14.095207 rx 3: GETATTR n2
14:44:14.095229 tx 3: OK, {tA=1s {M0100000 SZ=0 L=0 0:0 0 0:8954996 A 0.000000 M 0.000000 C 0.000000}}
14:44:14.099943 rx 4: ACCESS n2 {u=501 g=20 r}
14:44:14.099990 tx 4: 13=permission denied
By impementing `Getattr` (from `fs.NodeGetattrer`) on `VirtualConfNode`
this solves the issue.
|
|
|