X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/5dd5f9ec28f304ca377c42fd7f711d6cf12b90e1..5c19dc3ae3bd8e40a9c028b0deddd50ff337692c:/OSX/sec/securityd/SecLogSettingsServer.c diff --git a/OSX/sec/securityd/SecLogSettingsServer.c b/OSX/sec/securityd/SecLogSettingsServer.c new file mode 100644 index 00000000..14883efc --- /dev/null +++ b/OSX/sec/securityd/SecLogSettingsServer.c @@ -0,0 +1,48 @@ +// +// SecLogSettingsServer.c +// sec +// +// + +#include +#include +#include +#include +#include +#include +#include +#include + +CFPropertyListRef +SecCopyLogSettings_Server(CFErrorRef* error) +{ + return CopyCurrentScopePlist(); +} + +bool +SecSetXPCLogSettings_Server(CFTypeRef type, CFErrorRef* error) +{ + bool success = false; + if (isString(type)) { + ApplyScopeListForID(type, kScopeIDXPC); + success = true; + } else if (isDictionary(type)) { + ApplyScopeDictionaryForID(type, kScopeIDXPC); + success = true; + } else { + success = SecError(errSecParam, error, CFSTR("Unsupported CFType")); + } + + return success; +} + +bool +SecSetCircleLogSettings_Server(CFTypeRef type, CFErrorRef* error) +{ + bool success = false; + SOSAccountRef account = SOSKeychainAccountGetSharedAccount(); + if (account) { + success = SOSAccountPostDebugScope(account, type, error); + } + return success; +}