From: Alexandra Ellwood Date: Fri, 26 Sep 2008 14:05:55 +0000 (+0000) Subject: Initial checkin of Mac OS X ipc support. X-Git-Tag: krb5-1.7-alpha1~414 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b0cca8266580d7f22b6c91e9930cea2429555ddf;p=krb5.git Initial checkin of Mac OS X ipc support. Also moved "set application name" functionality to kim_library_ because most applications do not need to call it and their name doesn't usually change over time or per thread By putting it in a global setting apps that do need to call it only have to call it once instead of every time they want to authenticate. ticket: 6055 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20757 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/kim/kim_library.h b/src/include/kim/kim_library.h index 788896184..bd0e73bb5 100644 --- a/src/include/kim/kim_library.h +++ b/src/include/kim/kim_library.h @@ -38,16 +38,11 @@ typedef int kim_ui_environment; kim_error kim_library_set_ui_environment (kim_ui_environment in_ui_environment); -kim_ui_environment kim_library_ui_environment (void); - - kim_error kim_library_set_allow_home_directory_access (kim_boolean in_allow_access); -kim_boolean kim_library_allow_home_directory_access (void); - - kim_error kim_library_set_allow_automatic_prompting (kim_boolean in_allow_automatic_prompting); -kim_boolean kim_library_allow_automatic_prompting (void); +kim_error kim_library_set_application_name (kim_string in_application_name); + #endif /* KIM_LIBRARY_H */ diff --git a/src/kim/lib/kim-lite.exports b/src/kim/lib/kim-lite.exports index 96699c808..969ad8383 100644 --- a/src/kim/lib/kim-lite.exports +++ b/src/kim/lib/kim-lite.exports @@ -41,8 +41,6 @@ kim_selection_hints_create kim_selection_hints_copy kim_selection_hints_set_hint kim_selection_hints_get_hint -kim_selection_hints_set_application_name -kim_selection_hints_get_application_name kim_selection_hints_set_explanation kim_selection_hints_get_explanation kim_selection_hints_set_options diff --git a/src/kim/lib/kim.exports b/src/kim/lib/kim.exports index 96359632e..6381cbd81 100644 --- a/src/kim/lib/kim.exports +++ b/src/kim/lib/kim.exports @@ -41,8 +41,6 @@ kim_selection_hints_create kim_selection_hints_copy kim_selection_hints_set_hint kim_selection_hints_get_hint -kim_selection_hints_set_application_name -kim_selection_hints_get_application_name kim_selection_hints_set_explanation kim_selection_hints_get_explanation kim_selection_hints_set_options @@ -126,3 +124,8 @@ kim_ccache_renew kim_ccache_validate kim_ccache_destroy kim_ccache_free + +kim_library_set_ui_environment +kim_library_set_allow_home_directory_access +kim_library_set_allow_automatic_prompting +kim_library_set_application_name diff --git a/src/kim/lib/kim_library.c b/src/kim/lib/kim_library.c index 287ff3c63..c235fbda7 100644 --- a/src/kim/lib/kim_library.c +++ b/src/kim/lib/kim_library.c @@ -37,10 +37,12 @@ static k5_mutex_t g_allow_home_directory_access_mutex = K5_MUTEX_PARTIAL_INITIALIZER; static k5_mutex_t g_allow_automatic_prompting_mutex = K5_MUTEX_PARTIAL_INITIALIZER; static k5_mutex_t g_ui_environment_mutex = K5_MUTEX_PARTIAL_INITIALIZER; +static k5_mutex_t g_application_name_mutex = K5_MUTEX_PARTIAL_INITIALIZER; kim_boolean g_allow_home_directory_access = TRUE; kim_boolean g_allow_automatic_prompting = TRUE; kim_ui_environment g_ui_environment = KIM_UI_ENVIRONMENT_AUTO; +kim_string g_application_name = NULL; MAKE_INIT_FUNCTION(kim_thread_init); MAKE_FINI_FUNCTION(kim_thread_fini); @@ -63,6 +65,10 @@ static int kim_thread_init (void) err = k5_mutex_finish_init (&g_ui_environment_mutex); } + if (!err) { + err = k5_mutex_finish_init (&g_application_name_mutex); + } + return err; } @@ -77,6 +83,7 @@ static void kim_thread_fini (void) k5_mutex_destroy (&g_allow_home_directory_access_mutex); k5_mutex_destroy (&g_allow_automatic_prompting_mutex); k5_mutex_destroy (&g_ui_environment_mutex); + k5_mutex_destroy (&g_application_name_mutex); } #pragma mark -- Allow Home Directory Access -- @@ -282,3 +289,69 @@ kim_ui_environment kim_library_ui_environment (void) return !err ? ui_environment : KIM_UI_ENVIRONMENT_NONE; } + +#pragma mark -- Application Name -- + +/* ------------------------------------------------------------------------ */ + +kim_error kim_library_set_application_name (kim_string in_application_name) +{ + kim_error err = CALL_INIT_FUNCTION (kim_thread_init); + kim_error mutex_err = KIM_NO_ERROR; + + if (!err) { + mutex_err = k5_mutex_lock (&g_application_name_mutex); + if (mutex_err) { err = mutex_err; } + } + + if (!err) { + kim_string old_application_name = g_application_name; + + if (in_application_name) { + err = kim_string_copy (&g_application_name, in_application_name); + } else { + g_application_name = NULL; + } + + if (!err) { kim_string_free (&old_application_name); } + } + + if (!mutex_err) { k5_mutex_unlock (&g_application_name_mutex); } + return check_error (err); +} + +/* ------------------------------------------------------------------------ */ + +kim_error kim_library_get_application_name (kim_string *out_application_name) +{ + kim_error err = CALL_INIT_FUNCTION (kim_thread_init); + kim_error mutex_err = KIM_NO_ERROR; + kim_string application_name = NULL; + + if (!err && !out_application_name) { err = check_error (KIM_NULL_PARAMETER_ERR); } + + if (!err) { + mutex_err = k5_mutex_lock (&g_application_name_mutex); + if (mutex_err) { err = mutex_err; } + } + + if (!err && g_application_name) { + err = kim_string_copy (&application_name, g_application_name); + } + + if (!mutex_err) { k5_mutex_unlock (&g_application_name_mutex); } + + if (!err && !application_name) { + err = kim_os_library_get_caller_name (&application_name); + } + + if (!err) { + *out_application_name = application_name; + application_name = NULL; + + } + + kim_string_free (&application_name); + + return check_error (err); +} diff --git a/src/kim/lib/kim_library_private.h b/src/kim/lib/kim_library_private.h index 435bb51d4..b44cb6513 100644 --- a/src/kim/lib/kim_library_private.h +++ b/src/kim/lib/kim_library_private.h @@ -31,6 +31,17 @@ kim_ui_environment kim_os_library_get_ui_environment (void); +kim_ui_environment kim_library_ui_environment (void); + +kim_boolean kim_library_allow_home_directory_access (void); + +kim_boolean kim_library_allow_automatic_prompting (void); + +kim_error kim_library_get_application_name (kim_string *out_application_name); + +/* OS-specific. Call kim_library_get_application_name */ +kim_error kim_os_library_get_caller_name (kim_string *out_application_name); + kim_boolean kim_os_library_caller_is_server (void); #endif /* KIM_LIBRARY_PRIVATE_H */ diff --git a/src/kim/lib/kim_selection_hints.c b/src/kim/lib/kim_selection_hints.c index 1aa8555d8..a4d7d666a 100644 --- a/src/kim/lib/kim_selection_hints.c +++ b/src/kim/lib/kim_selection_hints.c @@ -28,7 +28,6 @@ struct kim_selection_hints_opaque { kim_string application_identifier; - kim_string application_name; kim_string explanation; kim_options options; kim_boolean allow_user_interaction; @@ -42,7 +41,6 @@ struct kim_selection_hints_opaque { }; struct kim_selection_hints_opaque kim_selection_hints_initializer = { - NULL, NULL, NULL, KIM_OPTIONS_DEFAULT, @@ -131,11 +129,6 @@ kim_error kim_selection_hints_copy (kim_selection_hints *out_selection_hints, in_selection_hints->application_identifier); } - if (!err && in_selection_hints->application_name) { - err = kim_string_copy (&selection_hints->application_name, - in_selection_hints->application_name); - } - if (!err && in_selection_hints->explanation) { err = kim_string_copy (&selection_hints->explanation, in_selection_hints->explanation); @@ -283,44 +276,6 @@ kim_error kim_selection_hints_get_hint (kim_selection_hints in_selection_hints, /* ------------------------------------------------------------------------ */ -kim_error kim_selection_hints_set_application_name (kim_selection_hints io_selection_hints, - kim_string in_application_name) -{ - kim_error err = KIM_NO_ERROR; - - if (!err && !io_selection_hints ) { err = check_error (KIM_NULL_PARAMETER_ERR); } - if (!err && !in_application_name) { err = check_error (KIM_NULL_PARAMETER_ERR); } - - if (!err) { - err = kim_string_copy (&io_selection_hints->application_name, in_application_name); - } - - return check_error (err); -} - -/* ------------------------------------------------------------------------ */ - -kim_error kim_selection_hints_get_application_name (kim_selection_hints in_selection_hints, - kim_string *out_application_name) -{ - kim_error err = KIM_NO_ERROR; - - if (!err && !in_selection_hints ) { err = check_error (KIM_NULL_PARAMETER_ERR); } - if (!err && !out_application_name) { err = check_error (KIM_NULL_PARAMETER_ERR); } - - if (!err) { - if (in_selection_hints->application_name) { - err = kim_string_copy (out_application_name, in_selection_hints->application_name); - } else { - *out_application_name = NULL; - } - } - - return check_error (err); -} - -/* ------------------------------------------------------------------------ */ - kim_error kim_selection_hints_set_explanation (kim_selection_hints io_selection_hints, kim_string in_explanation) { @@ -566,7 +521,6 @@ void kim_selection_hints_free (kim_selection_hints *io_selection_hints) { if (io_selection_hints && *io_selection_hints) { kim_string_free (&(*io_selection_hints)->application_identifier); - kim_string_free (&(*io_selection_hints)->application_name); kim_string_free (&(*io_selection_hints)->explanation); kim_options_free (&(*io_selection_hints)->options); kim_string_free (&(*io_selection_hints)->service_identity); diff --git a/src/kim/lib/kim_ui_cli.c b/src/kim/lib/kim_ui_cli.c index 0e5fc9ec4..0b0188854 100644 --- a/src/kim/lib/kim_ui_cli.c +++ b/src/kim/lib/kim_ui_cli.c @@ -231,7 +231,7 @@ static kim_error kim_ui_cli_ask_change_password (kim_string in_identity_string) kim_string unknown_response = NULL; kim_boolean done = 0; kim_comparison no_comparison, yes_comparison; - + if (!err) { err = kim_os_string_create_localized (&ask_change_password, "KLStringPasswordExpired"); @@ -324,7 +324,7 @@ kim_error kim_ui_cli_change_password (kim_ui_context *in_context, if (!err && !out_old_password ) { err = check_error (KIM_NULL_PARAMETER_ERR); } if (!err && !out_new_password ) { err = check_error (KIM_NULL_PARAMETER_ERR); } if (!err && !out_verify_password) { err = check_error (KIM_NULL_PARAMETER_ERR); } - + if (!err) { err = kim_identity_get_display_string (in_identity, &identity_string); } diff --git a/src/kim/lib/mac/kim_os_library.c b/src/kim/lib/mac/kim_os_library.c index 4abe13e20..ecac38ca3 100644 --- a/src/kim/lib/mac/kim_os_library.c +++ b/src/kim/lib/mac/kim_os_library.c @@ -25,6 +25,8 @@ */ #include +#include +#include #include #include "k5-int.h" #include "k5-thread.h" @@ -120,7 +122,7 @@ kim_boolean kim_os_library_caller_is_server (void) CFStringRef mainBundleID = CFBundleGetIdentifier (mainBundle); if (mainBundleID) { CFComparisonResult result; - result = CFStringCompare (mainBundleID, CFSTR("edu.mit.Kerberos.KerberosAgent"), 0); + result = CFStringCompare (mainBundleID, CFSTR(kim_os_agent_bundle_id), 0); if (result == kCFCompareEqualTo) { return TRUE; } @@ -129,3 +131,148 @@ kim_boolean kim_os_library_caller_is_server (void) return FALSE; } + +#pragma mark - + +/* ------------------------------------------------------------------------ */ + +kim_error kim_os_library_get_application_path (kim_string *out_path) +{ + kim_error err = KIM_NO_ERROR; + kim_string path = NULL; + CFBundleRef bundle = CFBundleGetMainBundle (); + + if (!err && !out_path) { err = check_error (KIM_NULL_PARAMETER_ERR); } + + /* Check if the caller is a bundle */ + if (!err && bundle) { + CFURLRef bundle_url = CFBundleCopyBundleURL (bundle); + CFURLRef resources_url = CFBundleCopyResourcesDirectoryURL (bundle); + CFURLRef executable_url = CFBundleCopyExecutableURL (bundle); + CFURLRef absolute_url = NULL; + CFStringRef cfpath = NULL; + + if (bundle_url && resources_url && !CFEqual (bundle_url, resources_url)) { + absolute_url = CFURLCopyAbsoluteURL (bundle_url); + } else if (executable_url) { + absolute_url = CFURLCopyAbsoluteURL (executable_url); + } + + if (absolute_url) { + cfpath = CFURLCopyFileSystemPath (absolute_url, + kCFURLPOSIXPathStyle); + if (!cfpath) { err = check_error (KIM_OUT_OF_MEMORY_ERR); } + } + + if (!err && cfpath) { + err = kim_os_string_create_from_cfstring (&path, cfpath); + } + + if (cfpath ) { CFRelease (cfpath); } + if (absolute_url ) { CFRelease (bundle_url); } + if (bundle_url ) { CFRelease (bundle_url); } + if (resources_url ) { CFRelease (resources_url); } + if (executable_url) { CFRelease (executable_url); } + } + + /* Caller is not a bundle, try _NSGetExecutablePath */ + /* Note: this does not work on CFM applications */ + if (!err && !path) { + char *buffer = NULL; + uint32_t len = 0; + + /* Tiny stupid buffer to get the length of the path */ + if (!err) { + buffer = malloc (1); + if (!buffer) { err = check_error (KIM_OUT_OF_MEMORY_ERR); } + } + + /* Get the length of the path */ + if (!err) { + if (_NSGetExecutablePath (buffer, &len) != 0) { + char *temp = realloc (buffer, len + 1); + if (!temp) { + err = check_error (KIM_OUT_OF_MEMORY_ERR); + } else { + buffer = temp; + } + } + } + + /* Get the path */ + if (!err) { + if (_NSGetExecutablePath (buffer, &len) != 0) { + err = check_error (KIM_OUT_OF_MEMORY_ERR); + } else { + err = kim_string_copy (&path, buffer); + } + } + + if (buffer) { free (buffer); } + } + + if (!err) { + *out_path = path; + path = NULL; + } + + kim_string_free (&path); + + return check_error (err); +} + +/* ------------------------------------------------------------------------ */ + +kim_error kim_os_library_get_caller_name (kim_string *out_application_name) +{ + kim_error err = KIM_NO_ERROR; + kim_string name = NULL; + CFBundleRef bundle = CFBundleGetMainBundle (); + CFStringRef cfname = NULL; + + if (!err && !out_application_name) { err = check_error (KIM_NULL_PARAMETER_ERR); } + + if (!err && bundle) { + CFURLRef bundle_url = CFBundleCopyBundleURL (bundle); + + if (bundle_url) { + err = LSCopyDisplayNameForURL (bundle_url, &cfname); + } + + if (bundle_url) { CFRelease (bundle_url); } + } + + if (!err && !name) { + kim_string path = NULL; + CFURLRef cfpath = NULL; + + err = kim_os_library_get_application_path (&path); + + if (!err) { + cfpath = CFURLCreateFromFileSystemRepresentation (kCFAllocatorDefault, + (const UInt8 *) path, + strlen (path), + 0); + if (cfpath) { + cfname = CFURLCopyLastPathComponent (cfpath); + } + } + + if (cfpath) { CFRelease (cfpath); } + } + + if (!err && cfname) { + err = kim_os_string_create_from_cfstring (&name, cfname); + } + + if (!err) { + *out_application_name = name; + name = NULL; + + } + + if (cfname) { CFRelease (cfname); } + kim_string_free (&name); + + return check_error (err); +} diff --git a/src/kim/lib/mac/kim_os_private.h b/src/kim/lib/mac/kim_os_private.h index 57176fe5e..f4a6710da 100644 --- a/src/kim/lib/mac/kim_os_private.h +++ b/src/kim/lib/mac/kim_os_private.h @@ -30,9 +30,13 @@ #include #include "kim_private.h" +#define kim_os_agent_bundle_id "edu.mit.Kerberos.KerberosAgent" + kim_error kim_os_library_lock_for_bundle_lookup (void); kim_error kim_os_library_unlock_for_bundle_lookup (void); +kim_error kim_os_library_get_application_path (kim_string *out_path); + kim_error kim_os_string_create_for_key (kim_string *out_string, kim_string in_key_string); @@ -47,4 +51,6 @@ kim_error kim_os_string_compare_to_cfstring (kim_string in_string, CFStringRef in_compare_to_cfstring, kim_comparison *out_comparison); +kim_error kim_os_library_get_application_path (kim_string *out_path); + #endif /* KIM_PRIVATE_H */ diff --git a/src/kim/lib/mac/kim_os_string.c b/src/kim/lib/mac/kim_os_string.c index fab5ed8fe..d51bc48b2 100644 --- a/src/kim/lib/mac/kim_os_string.c +++ b/src/kim/lib/mac/kim_os_string.c @@ -197,7 +197,7 @@ kim_error kim_os_string_create_from_cfstring (kim_string *out_string, kCFStringEncodingUTF8) + 1; string = (char *) calloc (length, sizeof (char)); - if (!string) { err = KIM_OUT_OF_MEMORY_ERR; } + if (!string) { err = check_error (KIM_OUT_OF_MEMORY_ERR); } } if (!err) { diff --git a/src/kim/lib/mac/kim_os_ui_gui.c b/src/kim/lib/mac/kim_os_ui_gui.c index afebb0504..184558439 100644 --- a/src/kim/lib/mac/kim_os_ui_gui.c +++ b/src/kim/lib/mac/kim_os_ui_gui.c @@ -26,10 +26,19 @@ #ifndef LEAN_CLIENT -#include "kim_private.h" +#include "kim_os_private.h" +#include "kim_mig_types.h" +#include "kim_mig.h" +#define kKerberosAgentBundleID "edu.mit.Kerberos.KerberosAgent" +#define kKerberosAgentPath "/System/Library/CoreServices/KerberosAgent.app/Contents/MacOS/KerberosAgent" + +#include +#include +#include struct kim_ui_gui_context { + mach_port_t port; }; @@ -58,6 +67,8 @@ static kim_error kim_os_ui_gui_context_allocate (kim_ui_gui_context *out_context } if (!err) { + context->port = MACH_PORT_NULL; + *out_context = context; context = NULL; } @@ -75,6 +86,7 @@ kim_error kim_os_ui_gui_init (kim_ui_context *io_context) { kim_error err = KIM_NO_ERROR; kim_ui_gui_context context = NULL; + kim_string path = NULL; if (!err && !io_context) { err = check_error (KIM_NULL_PARAMETER_ERR); } @@ -83,6 +95,31 @@ kim_error kim_os_ui_gui_init (kim_ui_context *io_context) } if (!err) { + err = kipc_client_lookup_server (kim_os_agent_bundle_id, + 1 /* launch */, + 0 /* don't use cached port */, + &context->port); + } + + if (!err) { + err = kim_os_library_get_application_path (&path); + } + + if (!err) { + kim_mipc_in_string application_name = NULL; + mach_msg_type_number_t application_name_len = 0; + kim_mipc_in_string application_path = path; + mach_msg_type_number_t application_path_len = strlen (path) + 1; + kim_mipc_error result = 0; + + err = kim_mipc_cli_init (context->port, + mach_task_self (), + application_name, + application_name_len, + application_path, + application_path_len, + &result); + if (!err) { err = check_error (result); } } if (!err) { @@ -90,6 +127,7 @@ kim_error kim_os_ui_gui_init (kim_ui_context *io_context) context = NULL; } + kim_string_free (&path); kim_os_ui_gui_context_free (&context); return check_error (err); @@ -108,6 +146,7 @@ kim_error kim_os_ui_gui_enter_identity (kim_ui_context *in_context, if (!err) { kim_ui_gui_context context = (kim_ui_gui_context) in_context->tcontext; + } return check_error (err); @@ -136,7 +175,7 @@ kim_error kim_os_ui_gui_select_identity (kim_ui_context *in_context, /* ------------------------------------------------------------------------ */ kim_error kim_os_ui_gui_auth_prompt (kim_ui_context *in_context, - kim_identity in_identity, + kim_identity in_identity, kim_prompt_type in_type, kim_boolean in_hide_reply, kim_string in_title, diff --git a/src/kim/mac/kim_mig.defs b/src/kim/mac/kim_mig.defs new file mode 100644 index 000000000..ad10c7418 --- /dev/null +++ b/src/kim/mac/kim_mig.defs @@ -0,0 +1,106 @@ +/* + * $Header$ + * + * Copyright 2006-2008 Massachusetts Institute of Technology. + * All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ + +#include +#include + +import "kim_mig_types.h"; + +subsystem kim 100; + +serverprefix kim_mipc_srv_; +userprefix kim_mipc_cli_; + +type kim_mipc_in_string = array [] of char; +type kim_mipc_out_string = array [] of char; +type kim_mipc_error = int32_t; +type kim_mipc_boolean = boolean_t; +type kim_mipc_time = uint32_t; +type kim_mipc_lifetime = uint32_t; +type kim_mipc_prompt_type = uint32_t; + +routine init (in_server_port : mach_port_t; + in_application_task : task_t; + in_application_name : kim_mipc_in_string; + in_application_path : kim_mipc_in_string; + out out_error : kim_mipc_error); + +routine fini (in_server_port : mach_port_t; + out out_error : kim_mipc_error); + + +routine enter_identity (in_server_port : mach_port_t; + out out_identity : kim_mipc_out_string; + out out_error : kim_mipc_error); + +routine select_identity (in_server_port : mach_port_t; + in_explanation : kim_mipc_in_string; + + in_start_time : kim_mipc_time; + in_lifetime : kim_mipc_lifetime; + in_renewable : kim_mipc_boolean; + in_renewal_lifetime : kim_mipc_lifetime; + in_forwardable : kim_mipc_boolean; + in_proxiable : kim_mipc_boolean; + in_addressless : kim_mipc_boolean; + in_service_name : kim_mipc_in_string; + + in_service_identity_hint : kim_mipc_in_string; + in_client_realm_hint : kim_mipc_in_string; + in_user_hint : kim_mipc_in_string; + in_service_realm_hint : kim_mipc_in_string; + in_service_hint : kim_mipc_in_string; + in_server_hint : kim_mipc_in_string; + + out out_identity : kim_mipc_out_string; + out out_error : kim_mipc_error); + +routine auth_prompt (in_server_port : mach_port_t; + in_identity : kim_mipc_in_string; + in_prompt_type : kim_mipc_prompt_type; + in_hidden : kim_mipc_boolean; + in_title : kim_mipc_in_string; + in_message : kim_mipc_in_string; + in_description : kim_mipc_in_string; + out out_response : kim_mipc_out_string; + out out_error : kim_mipc_error); + +routine change_password (in_server_port : mach_port_t; + in_identity : kim_mipc_in_string; + in_old_password_expired : kim_mipc_boolean; + out out_old_password : kim_mipc_out_string; + out out_new_password : kim_mipc_out_string; + out out_verify_password : kim_mipc_out_string; + out out_error : kim_mipc_error); + + routine handle_error (in_server_port : mach_port_t; + in_identity : kim_mipc_in_string; + in_error : kim_mipc_error; + in_message : kim_mipc_in_string; + in_description : kim_mipc_in_string; + out out_error : kim_mipc_error); + + diff --git a/src/kim/mac/kim_mig_types.h b/src/kim/mac/kim_mig_types.h new file mode 100644 index 000000000..189fe06eb --- /dev/null +++ b/src/kim/mac/kim_mig_types.h @@ -0,0 +1,40 @@ +/* + * $Header$ + * + * Copyright 2006-2008 Massachusetts Institute of Technology. + * All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ + +#ifndef KIM_MIG_H +#define KIM_MIG_H + +#include + +typedef const char *kim_mipc_in_string; +typedef char *kim_mipc_out_string; +typedef int32_t kim_mipc_error; +typedef boolean_t kim_mipc_boolean; +typedef uint32_t kim_mipc_lifetime; +typedef uint32_t kim_mipc_time; +typedef uint32_t kim_mipc_prompt_type; + +#endif /* KIM_MIG_H */ diff --git a/src/kim/test/test_kim_preferences.c b/src/kim/test/test_kim_preferences.c index fb785465a..c364fc6fb 100644 --- a/src/kim/test/test_kim_preferences.c +++ b/src/kim/test/test_kim_preferences.c @@ -877,8 +877,7 @@ void test_kim_preferences_remove_favorite_identity (kim_test_state_t state) fail_if_error (state, "kim_preferences_get_favorite_identity_at_index", err, "while getting favorite identity %d", (int) j); - if (!err) - { + if (!err) { kim_identity_get_display_string(compare_identity, &string); err = kim_preferences_remove_favorite_identity(prefs, compare_identity); fail_if_error (state, "kim_preferences_remove_favorite_identity", err,