diff options
| author | Jakob Unterwurzacher | 2026-11-11 21:11:43 +0100 |
|---|---|---|
| committer | Jakob Unterwurzacher | 2026-11-11 21:11:43 +0100 |
| commit | dfdf47d790fa758a9f443764ad296e86c9007ece (patch) | |
| tree | db488b0b7400742d5e7d42832fb8d246eb3ca4a7 /tests/reverse/ctlsock_reverse_test_fs/file | |
| parent | 8caa5dddeebaf7116c9fa12a64cac1aca567df58 (diff) | |
reverse: don't follow symlinks when serving gocryptfs.conf
.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>
Diffstat (limited to 'tests/reverse/ctlsock_reverse_test_fs/file')
0 files changed, 0 insertions, 0 deletions
