From 40b2939118a65eb88780fb6a5f67b340fd302030 Mon Sep 17 00:00:00 2001 From: Alexandra Ellwood Date: Tue, 7 Oct 2008 19:23:10 +0000 Subject: [PATCH] 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 --- src/kim/lib/mac/kim_os_library.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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) { -- 2.26.2