diff options
| author | Jakob Unterwurzacher | 2026-02-07 21:19:14 +0100 |
|---|---|---|
| committer | Jakob Unterwurzacher | 2026-02-08 20:27:30 +0100 |
| commit | 3384217ee698a6c5d0eca2078961a69d9cbe0be0 (patch) | |
| tree | 4dd8c828307950c0fad9b51340cd4f1aad8961fb /internal/fusefrontend/root_node.go | |
| parent | d44e93d6252566e646ea5bc917ce408594727cdd (diff) | |
darwin: syscallcompat: Openat: use O_SYMLINK
Also add tests that opening a symlink (using unix.O_PATH | unix.O_NOFOLLOW)
works.
https://github.com/rfjakob/gocryptfs/issues/993
Diffstat (limited to 'internal/fusefrontend/root_node.go')
| -rw-r--r-- | internal/fusefrontend/root_node.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/fusefrontend/root_node.go b/internal/fusefrontend/root_node.go index 489e3c6..362290d 100644 --- a/internal/fusefrontend/root_node.go +++ b/internal/fusefrontend/root_node.go @@ -124,11 +124,11 @@ func (rn *RootNode) mangleOpenFlags(flags uint32) (newFlags int) { // accesses. Running xfstests generic/013 on ext4 used to trigger lots of // EINVAL errors due to missing alignment. Just fall back to buffered IO. newFlags = newFlags &^ syscallcompat.O_DIRECT - // Create and Open are two separate FUSE operations, so O_CREAT should not - // be part of the open flags. + // Create and Open are two separate FUSE operations, so O_CREAT should usually not + // be part of the Open() flags. Create() will add O_CREAT back itself. newFlags = newFlags &^ syscall.O_CREAT - // We always want O_NOFOLLOW to be safe against symlink races - newFlags |= syscall.O_NOFOLLOW + // We always want O_NOFOLLOW/O_SYMLINK to be safe against symlink races + newFlags |= syscallcompat.OpenatFlagNofollowSymlink return newFlags } |
