From d61448ec88f064eba898b566f68324859df5f7ac Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 11 Nov 2026 21:02:25 +0100 Subject: syscallcompat: drop Faccessat helper, use unix.Faccessat with AT_SYMLINK_NOFOLLOW Our helper did Fstatat(AT_SYMLINK_NOFOLLOW) followed by a symlink-following unix.Faccessat(..., 0). If the file is swapped for a symlink in between, we check access on the symlink target. x/sys now handles AT_SYMLINK_NOFOLLOW on all our platforms: faccessat2 with fallback emulation on Linux, libc faccessat on Darwin, and the native syscall on FreeBSD. The Darwin breakage that caused the revert in 3d6b2685 should no longer apply. Co-Authored-By: Claude Opus 5.5 --- tests/reverse/correctness_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests/reverse/correctness_test.go') diff --git a/tests/reverse/correctness_test.go b/tests/reverse/correctness_test.go index 4028ac3..f0c6f54 100644 --- a/tests/reverse/correctness_test.go +++ b/tests/reverse/correctness_test.go @@ -12,7 +12,6 @@ import ( "golang.org/x/sys/unix" "github.com/rfjakob/gocryptfs/v2/ctlsock" - "github.com/rfjakob/gocryptfs/v2/internal/syscallcompat" "github.com/rfjakob/gocryptfs/v2/tests/test_helpers" ) @@ -160,12 +159,12 @@ func TestAccess(t *testing.T) { } for _, n := range names { // Check if file exists - this should never fail - err = syscallcompat.Faccessat(unix.AT_FDCWD, dirB+"/"+n, unix.F_OK) + err = unix.Faccessat(unix.AT_FDCWD, dirB+"/"+n, unix.F_OK, unix.AT_SYMLINK_NOFOLLOW) if err != nil { t.Errorf("%s: %v", n, err) } // Check if file is readable - err = syscallcompat.Faccessat(unix.AT_FDCWD, dirB+"/"+n, unix.R_OK) + err = unix.Faccessat(unix.AT_FDCWD, dirB+"/"+n, unix.R_OK, unix.AT_SYMLINK_NOFOLLOW) if err != nil { t.Logf("%s: %v", n, err) } -- cgit v1.2.3