From 04e2fc2c76ee3cdf554c6996b619fc909528fde6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 30 Apr 2026 09:00:09 +1000 Subject: [PATCH] testsuite: skip symlink-dirlink-basis on platforms without RESOLVE_BENEATH secure_relative_open() has a kernel-enforced "stay below dirfd" path on Linux 5.6+ (openat2 RESOLVE_BENEATH) and FreeBSD 13+ (openat O_RESOLVE_BENEATH). On Solaris, OpenBSD, NetBSD, and Cygwin the code falls back to the per-component O_NOFOLLOW walk, which by design rejects every directory symlink in the path -- the very case this test exercises. Mark the test skipped there rather than have it fail with a known regression that's tracked separately. macOS is intentionally not in the skip list: although it does not have O_RESOLVE_BENEATH either, the test passes there in practice; investigation of the underlying reason is left as follow-up. Co-Authored-By: Claude Opus 4.7 (1M context) --- testsuite/symlink-dirlink-basis.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/testsuite/symlink-dirlink-basis.test b/testsuite/symlink-dirlink-basis.test index 9065dd81..a14eb5cf 100755 --- a/testsuite/symlink-dirlink-basis.test +++ b/testsuite/symlink-dirlink-basis.test @@ -26,6 +26,18 @@ . "$suitedir/rsync.fns" +# secure_relative_open() uses kernel-enforced "stay below dirfd" via +# openat2(RESOLVE_BENEATH) on Linux 5.6+ and openat(O_RESOLVE_BENEATH) +# on FreeBSD 13+. Other platforms fall back to a per-component +# O_NOFOLLOW walk that rejects every symlink including legitimate +# directory symlinks -- the very case this test exercises. Skip on +# those rather than report a known failure. +case "$(uname -s)" in + SunOS|OpenBSD|NetBSD|CYGWIN*) + test_skipped "secure_relative_open lacks RESOLVE_BENEATH equivalent on $(uname -s); issue #715 still affects this platform" + ;; +esac + RSYNC_RSH="$scratchdir/src/support/lsh.sh" export RSYNC_RSH