]>
git.saurik.com Git - apple/dyld.git/blob - unit-tests/test-cases/dlopen-codesign-dynamic/main.c
9 #include <System/sys/codesign.h>
17 uint32_t flags
= CS_ENFORCEMENT
| CS_KILL
;
18 if ( csops(0, CS_OPS_SET_STATUS
, &flags
, sizeof(flags
)) != 0 ) {
19 FAIL("dlopen-codesign-dynamic: csops() failed");
23 void* handle
= dlopen("libfoo.dylib", RTLD_LAZY
);
24 if ( handle
!= NULL
) {
25 FAIL("dlopen-codesign-dynamic: load of libfoo.dylib should have failed");
28 const char* msg
= dlerror();
29 if ( strstr(msg
, "signature") == NULL
) {
30 FAIL("dlopen-codesign-dynamic: load of libfoo.dylib failed, but message was wrong: %s", msg
);
35 void* handle
= dlopen("libfoo.dylib", RTLD_LAZY
);
36 if ( handle
== NULL
) {
37 FAIL("dlopen-codesign-dynamic: load of libfoo.dylib failed");
43 PASS("dlopen-codesign-dynamic");