]> git.saurik.com Git - apple/security.git/blobdiff - OSX/sec/securityd/SecLogSettingsServer.c
Security-57336.1.9.tar.gz
[apple/security.git] / OSX / sec / securityd / SecLogSettingsServer.c
diff --git a/OSX/sec/securityd/SecLogSettingsServer.c b/OSX/sec/securityd/SecLogSettingsServer.c
new file mode 100644 (file)
index 0000000..14883ef
--- /dev/null
@@ -0,0 +1,48 @@
+//
+//  SecLogSettingsServer.c
+//  sec
+//
+//
+
+#include <securityd/SecLogSettingsServer.h>
+#include <securityd/SOSCloudCircleServer.h>
+#include <Security/SecBase.h>
+#include <Security/SecLogging.h>
+#include <Security/SecureObjectSync/SOSTransportCircle.h>
+#include <utilities/debugging.h>
+#include <utilities/SecCFWrappers.h>
+#include <utilities/SecCFError.h>
+
+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;
+}