From c190dcdbbd623b76a2be7c41240fcc9ede35bac8 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 7 Feb 2026 21:19:14 +0100 Subject: 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 --- internal/syscallcompat/sys_darwin.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'internal/syscallcompat/sys_darwin.go') diff --git a/internal/syscallcompat/sys_darwin.go b/internal/syscallcompat/sys_darwin.go index 0ebdd3b..ef19f24 100644 --- a/internal/syscallcompat/sys_darwin.go +++ b/internal/syscallcompat/sys_darwin.go @@ -27,6 +27,10 @@ const ( // Only exists on Linux. Define here to fix build failure, even though // we will never see this flag. RENAME_WHITEOUT = 1 << 30 + + // On Darwin we use O_SYMLINK which allows opening a symlink itself. + // On Linux, we only have O_NOFOLLOW. + OpenatFlagNofollowSymlink = unix.O_SYMLINK ) // Unfortunately fsetattrlist does not have a syscall wrapper yet. -- cgit v1.2.3