X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/5c19dc3ae3bd8e40a9c028b0deddd50ff337692c..refs/heads/master:/OSX/libsecurity_authorization/lib/Authorization.cpp diff --git a/OSX/libsecurity_authorization/lib/Authorization.cpp b/OSX/libsecurity_authorization/lib/Authorization.cpp index 71db80cf..5cdbab48 100644 --- a/OSX/libsecurity_authorization/lib/Authorization.cpp +++ b/OSX/libsecurity_authorization/lib/Authorization.cpp @@ -34,6 +34,7 @@ #include #include #include +#include "LegacyAPICounts.h" // // This no longer talks to securityd; it is a kernel function. @@ -105,75 +106,7 @@ OSStatus SessionGetDistinguishedUser(SecuritySessionId session, uid_t *user) END_API(CSSM) } -//OSStatus _SessionSetUserPreferences(SecuritySessionId session); -// -//static -//void SessionUserPreferencesChanged(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) -//{ -//#warning "The cast will loose some information" -// _SessionSetUserPreferences((SecuritySessionId)uintptr_t(observer)); -//} -// -//OSStatus _SessionSetUserPreferences(SecuritySessionId session) -//{ -// BEGIN_API -// CFStringRef appleLanguagesStr = CFSTR("AppleLanguages"); -// CFStringRef controlTintStr = CFSTR("AppleAquaColorVariant"); -// CFStringRef keyboardUIModeStr = CFSTR("AppleKeyboardUIMode"); -// CFStringRef textDirectionStr = CFSTR("AppleTextDirection"); -// CFStringRef hitoolboxAppIDStr = CFSTR("com.apple.HIToolbox"); -// CFNotificationCenterRef center = CFNotificationCenterGetDistributedCenter(); -// -// CFRef userPrefsDict(CFDictionaryCreateMutable(NULL, 10, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); -// CFRef globalPrefsDict(CFDictionaryCreateMutable(NULL, 10, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); -// -// if (!userPrefsDict || !globalPrefsDict) -// return errSessionValueNotSet; -// -// CFRef appleLanguagesArray(static_cast(CFPreferencesCopyAppValue(appleLanguagesStr, kCFPreferencesCurrentApplication))); -// if (appleLanguagesArray) -// CFDictionarySetValue(globalPrefsDict, appleLanguagesStr, appleLanguagesArray); -// -// CFRef controlTintNumber(static_cast(CFPreferencesCopyAppValue(controlTintStr, kCFPreferencesCurrentApplication))); -// if (controlTintNumber) -// CFDictionarySetValue(globalPrefsDict, controlTintStr, controlTintNumber); -// -// CFRef keyboardUIModeNumber(static_cast(CFPreferencesCopyAppValue(keyboardUIModeStr, kCFPreferencesCurrentApplication))); -// if (keyboardUIModeNumber) -// CFDictionarySetValue(globalPrefsDict, keyboardUIModeStr, keyboardUIModeNumber); -// -// CFRef textDirectionNumber(static_cast(CFPreferencesCopyAppValue(textDirectionStr, kCFPreferencesCurrentApplication))); -// if (textDirectionNumber) -// CFDictionarySetValue(globalPrefsDict, textDirectionStr, textDirectionNumber); -// -// if (CFDictionaryGetCount(globalPrefsDict) > 0) -// CFDictionarySetValue(userPrefsDict, kCFPreferencesAnyApplication, globalPrefsDict); -// -// CFPreferencesSynchronize(hitoolboxAppIDStr, kCFPreferencesCurrentUser, -// kCFPreferencesCurrentHost); -// CFRef hitoolboxPrefsDict(static_cast(CFPreferencesCopyMultiple(NULL, hitoolboxAppIDStr, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost))); -// if (hitoolboxPrefsDict) { -// CFDictionarySetValue(userPrefsDict, hitoolboxAppIDStr, hitoolboxPrefsDict); -// CFNotificationCenterPostNotification(center, CFSTR("com.apple.securityagent.InputPrefsChanged"), CFSTR("com.apple.loginwindow"), hitoolboxPrefsDict, true); -// } -// -// CFRef userPrefsData(CFPropertyListCreateXMLData(NULL, userPrefsDict)); -// if (!userPrefsData) -// return errSessionValueNotSet; -// server().setSessionUserPrefs(session, (uint32_t)CFDataGetLength(userPrefsData), CFDataGetBytePtr(userPrefsData)); -// -// END_API(CSSM) -//} - OSStatus SessionSetUserPreferences(SecuritySessionId session) { -// OSStatus status = _SessionSetUserPreferences(session); -// if (errSecSuccess == status) { -// CFNotificationCenterRef center = CFNotificationCenterGetDistributedCenter(); -// // We've succeeded in setting up a static set of prefs, now set up -// CFNotificationCenterAddObserver(center, (void*)session, SessionUserPreferencesChanged, CFSTR("com.apple.Carbon.TISNotifySelectedKeyboardInputSourceChanged"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately); -// CFNotificationCenterAddObserver(center, (void*)session, SessionUserPreferencesChanged, CFSTR("com.apple.Carbon.TISNotifyEnabledKeyboardInputSourcesChanged"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately); -// } -// return status; return errSecSuccess; }