Skip to content

Commit 6a82023

Browse files
committed
Add notes on other topics
1 parent 39f11e3 commit 6a82023

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

notes.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Access ACLs:
2+
3+
SecAccessRef access = NULL;
4+
OSStatus status = SecKeychainItemCopyAccess(item, &access);
5+
SRHandleError(status, true);
6+
7+
CFArrayRef aclList = NULL;
8+
status = SecAccessCopyACLList(access, &aclList);
9+
SRHandleError(status, true);
10+
11+
for (int j = 0; j < CFArrayGetCount(aclList); j++) {
12+
SecACLRef acl = (SecACLRef)CFArrayGetValueAtIndex(aclList, j);
13+
CFArrayRef applicationList = NULL;
14+
CFStringRef description = NULL;
15+
SecKeychainPromptSelector prompt = 0;
16+
status = SecACLCopyContents(acl, &applicationList, &description, &prompt);
17+
SRHandleError(status, true);
18+
19+
printf(" %s\n", SRCFStringCopyUTF8String(description));
20+
CFShow(applicationList);
21+
22+
if (description) { CFRelease(description); }
23+
if (applicationList) { CFRelease(applicationList); }
24+
}
25+
26+
CFRelease(aclList);
27+
CFRelease(access);

0 commit comments

Comments
 (0)