From 5d8ffe0d0351b7b3b4eb89505c49983d187fa634 Mon Sep 17 00:00:00 2001 From: Alexandra Ellwood Date: Mon, 29 Sep 2008 21:39:42 +0000 Subject: [PATCH] Support legacy KerberosAgent preference for save passwords and a new preference in the KIM preferences. Updated test harness for save password arguments. ticket: 6055 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20782 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kim/agent/mac/ServerDemux.m | 2 +- src/kim/lib/mac/kim_os_identity.c | 18 ++++++++++++++++-- src/kim/lib/mac/kim_os_preferences.c | 3 --- src/kim/lib/mac/kim_os_private.h | 4 ++++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/kim/agent/mac/ServerDemux.m b/src/kim/agent/mac/ServerDemux.m index a70a668c4..c09d7ec85 100644 --- a/src/kim/agent/mac/ServerDemux.m +++ b/src/kim/agent/mac/ServerDemux.m @@ -302,7 +302,7 @@ static int32_t kim_handle_request_auth_prompt (mach_port_t in_client_port, } if (!err) { - NSLog (@"Got auth prompt with identity '%s', type '%d', hide '%d', title '%s', message '%s', description '%s'", + NSLog (@"Got auth prompt with identity '%s', type '%d', allow_save_reply '%d', hide '%d', title '%s', message '%s', description '%s'", identity_string, type, hide_reply, title, message, description); err = kim_handle_reply_auth_prompt (in_reply_port, "ydobon", 0, 0); #warning Send auth prompt message to main thread with 2 ports and arguments diff --git a/src/kim/lib/mac/kim_os_identity.c b/src/kim/lib/mac/kim_os_identity.c index fba941820..3044b21ac 100644 --- a/src/kim/lib/mac/kim_os_identity.c +++ b/src/kim/lib/mac/kim_os_identity.c @@ -38,16 +38,30 @@ kim_boolean kim_os_identity_allow_save_password (void) CFPropertyListRef disable_pref = NULL; disable_pref = CFPreferencesCopyValue (CFSTR ("SavePasswordDisabled"), - CFSTR ("edu.mit.Kerberos.KerberosAgent"), + KIM_PREFERENCES_FILE, kCFPreferencesAnyUser, kCFPreferencesAnyHost); if (!disable_pref) { disable_pref = CFPreferencesCopyValue (CFSTR ("SavePasswordDisabled"), - CFSTR ("edu.mit.Kerberos.KerberosAgent"), + KIM_PREFERENCES_FILE, kCFPreferencesAnyUser, kCFPreferencesCurrentHost); } + if (!disable_pref) { + disable_pref = CFPreferencesCopyValue (CFSTR ("SavePasswordDisabled"), + KA_PREFERENCES_FILE, + kCFPreferencesAnyUser, + kCFPreferencesAnyHost); + } + + if (!disable_pref) { + disable_pref = CFPreferencesCopyValue (CFSTR ("SavePasswordDisabled"), + KA_PREFERENCES_FILE, + kCFPreferencesAnyUser, + kCFPreferencesCurrentHost); + } + disabled = (disable_pref && CFGetTypeID (disable_pref) == CFBooleanGetTypeID () && CFBooleanGetValue (disable_pref)); diff --git a/src/kim/lib/mac/kim_os_preferences.c b/src/kim/lib/mac/kim_os_preferences.c index a915046a3..152132c04 100644 --- a/src/kim/lib/mac/kim_os_preferences.c +++ b/src/kim/lib/mac/kim_os_preferences.c @@ -28,9 +28,6 @@ #include "kim_os_private.h" -#define KIM_PREFERENCES_FILE CFSTR("edu.mit.Kerberos.IdentityManagement") -#define KLL_PREFERENCES_FILE CFSTR("edu.mit.Kerberos.KerberosLogin") - #define kim_os_preference_any_identity "KIM_IDENTITY_ANY" #pragma mark - diff --git a/src/kim/lib/mac/kim_os_private.h b/src/kim/lib/mac/kim_os_private.h index f4a6710da..039502a7e 100644 --- a/src/kim/lib/mac/kim_os_private.h +++ b/src/kim/lib/mac/kim_os_private.h @@ -32,6 +32,10 @@ #define kim_os_agent_bundle_id "edu.mit.Kerberos.KerberosAgent" +#define KIM_PREFERENCES_FILE CFSTR("edu.mit.Kerberos.IdentityManagement") +#define KLL_PREFERENCES_FILE CFSTR("edu.mit.Kerberos.KerberosLogin") +#define KA_PREFERENCES_FILE CFSTR("edu.mit.Kerberos.KerberosAgent") + kim_error kim_os_library_lock_for_bundle_lookup (void); kim_error kim_os_library_unlock_for_bundle_lookup (void); -- 2.26.2