Fix TestAttachDenied on macOS Mojave

TestAttachDenied tries to attach to a process that is ptracing itself and
verifies that we error out. Starting with macOS Mojave, processes need
an entitlement to be able to ptrace. This commit adds the entitlement for
the test binary when building on Darwin.

llvm-svn: 337029
This commit is contained in:
Frederic Riss 2018-07-13 17:45:43 +00:00
parent 75c4f5552e
commit 8e04d937b0
2 changed files with 15 additions and 0 deletions

View File

@ -4,4 +4,11 @@ CXX_SOURCES := main.cpp
EXE := AttachDenied
all: AttachDenied sign
include $(LEVEL)/Makefile.rules
sign: entitlements.plist AttachDenied
ifeq ($(OS),Darwin)
codesign -s - -f --entitlements $^
endif

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.debugger</key>
<true/>
</dict>
</plist>