]> git.saurik.com Git - apple/security.git/blob - keychain/securityd/SecLogSettingsServer.m
Security-59306.41.2.tar.gz
[apple/security.git] / keychain / securityd / SecLogSettingsServer.m
1 //
2 // SecLogSettingsServer.c
3 // sec
4 //
5 //
6
7 #include "keychain/securityd/SecLogSettingsServer.h"
8 #include "keychain/SecureObjectSync/SOSAccountPriv.h"
9 #include <Security/SecBase.h>
10 #include <Security/SecLogging.h>
11 #include "keychain/SecureObjectSync/SOSTransportCircle.h"
12 #include <utilities/debugging.h>
13 #include <utilities/SecCFWrappers.h>
14 #include <utilities/SecCFError.h>
15
16 CFPropertyListRef
17 SecCopyLogSettings_Server(CFErrorRef* error)
18 {
19 return CopyCurrentScopePlist();
20 }
21
22 bool
23 SecSetXPCLogSettings_Server(CFTypeRef type, CFErrorRef* error)
24 {
25 bool success = false;
26 if (isString(type)) {
27 ApplyScopeListForID(type, kScopeIDXPC);
28 success = true;
29 } else if (isDictionary(type)) {
30 ApplyScopeDictionaryForID(type, kScopeIDXPC);
31 success = true;
32 } else {
33 success = SecError(errSecParam, error, CFSTR("Unsupported CFType"));
34 }
35
36 return success;
37 }
38
39 bool
40 SecSetCircleLogSettings_Server(CFTypeRef type, CFErrorRef* error)
41 {
42 bool success = false;
43 SOSAccount* account = (__bridge SOSAccount*)SOSKeychainAccountGetSharedAccount();
44 if (account) {
45 success = SOSAccountPostDebugScope(account, type, error);
46 }
47 return success;
48 }
49