On May 27, 2012, at 9:55 PM, Graham Cox wrote:

> Currently though, my implementation falls at the first hurdle, which is here:
> 
> CFArrayRef recentLibraries = 
> CFPreferencesCopyAppValue((CFStringRef)@"iPhotoRecentDatabases",(CFStringRef)@"com.apple.iApps");
> 
> 
> This returns nil in the sandboxed version, even though I have added 
> /Library/Preferences/com.apple.iApps.plist to my temporary exception 
> entitlements (user relative, read only). Oddly, I do not get a sandboxd deny 
> logged, which is why I was assuming it wasn't working at first. It must be 
> something else, but it works just fine in the non-sandboxed app. Anyone else 
> run into this?

AppSandboxDesignGuide.pdf says:
======================
Accessing Preferences of Other Apps

Because App Sandbox directs path-finding APIs to the container for your app, 
reading or writing to the user’s preferences takes place within the container. 
Preferences for other sandboxed apps are inaccessible. Preferences for apps 
that are not sandboxed are placed in the ~/Library/Preferences directory, which 
is also inaccessible to your sandboxed app.

If your app requires access to another app’s preferences in order to 
function—for example, if it requires access to the playlists that a user has 
defined for iTunes—let Apple know about your needs using the Apple bug re- 
porting system. In addition, be sure to follow the guidance regarding 
entitlements provided on the iTunes Connect website.

With these provisos in mind, you can use a path-based temporary exception 
entitlement to gain programmatic access to the user’s ~/Library/Preferences 
folder. Use a read-only entitlement to avoid opening the user’s preferences to 
malicious exploitation. A POSIX function, such as getpwuid, can provide the 
file system path you need. For details on entitlements, see Entitlement Key 
Reference .
========================

I think that is your issue.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to