From: Alexandra Ellwood Date: Tue, 7 Oct 2008 19:23:10 +0000 (+0000) Subject: If the caller is a bundle, look up keys in its plist file to get the name X-Git-Tag: krb5-1.7-alpha1~337 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=40b2939118a65eb88780fb6a5f67b340fd302030;p=krb5.git If the caller is a bundle, look up keys in its plist file to get the name ticket: 6146 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20836 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kim/lib/mac/kim_os_library.c b/src/kim/lib/mac/kim_os_library.c index b0781bbf2..63edfde32 100644 --- a/src/kim/lib/mac/kim_os_library.c +++ b/src/kim/lib/mac/kim_os_library.c @@ -233,14 +233,17 @@ kim_error kim_os_library_get_caller_name (kim_string *out_application_name) if (!err && !out_application_name) { err = check_error (KIM_NULL_PARAMETER_ERR); } if (!err && bundle) { - CFURLRef bundle_url = CFBundleCopyBundleURL (bundle); + cfname = CFBundleGetValueForInfoDictionaryKey (bundle, + kCFBundleNameKey); - if (bundle_url) { - err = LSCopyDisplayNameForURL (bundle_url, &cfname); - check_error (err); + if (!cfname || CFGetTypeID (cfname) != CFStringGetTypeID ()) { + cfname = CFBundleGetValueForInfoDictionaryKey (bundle, + kCFBundleExecutableKey); } - if (bundle_url) { CFRelease (bundle_url); } + if (cfname) { + cfname = CFStringCreateCopy (kCFAllocatorDefault, cfname); + } } if (!err && !cfname) {