From 05afc1addbb0aed00e5fefdfcb870904b3fccc27 Mon Sep 17 00:00:00 2001 From: Vincent Taverna Date: Mon, 2 Nov 2026 17:09:02 -0500 Subject: [PATCH] Stop ancestry checks at the lock owner Signed-off-by: Vincent Taverna --- Tests/ParcelTestSupport/NativeHostAvailability.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tests/ParcelTestSupport/NativeHostAvailability.swift b/Tests/ParcelTestSupport/NativeHostAvailability.swift index 1809e802..da1be851 100644 --- a/Tests/ParcelTestSupport/NativeHostAvailability.swift +++ b/Tests/ParcelTestSupport/NativeHostAvailability.swift @@ -31,6 +31,8 @@ public enum NativeHostAvailability { var pid = getppid() while pid > 1, !ancestors.contains(pid) { ancestors.append(pid) + // Higher ancestors may be protected system processes; the lock owner is sufficient. + if NativeHostPolicy.ownsLock(owner: owner, ancestors: ancestors) { break } var info = proc_bsdinfo() let size = Int32(MemoryLayout.size) guard proc_pidinfo(pid, PROC_PIDTBSDINFO, 0, &info, size) == size else { -- knotmirror 0.0.1