[launchd-dev] Mysterious problem with [NSURL getResourceValue:forKey:error:]
James Bucanek
subscriber at gloaming.com
Wed Aug 17 21:21:43 PDT 2016
Greetings,
I've stumbled across a strange problem with [NSURL
getResourceValue:forKey:error:] returning blank icons when executed
within the context of a system daemon.
I'm using this method to get the NSURLEffectiveIconKey (an NSImage)
value for items. The process is launched by a privileged helper
(installed a la EvenBetterAuthorizationSample). It's a SetUID
executable, so its effective UID is the user (let's say 501) for which I
want to get the icons (and other localized information).
When the process is launched by the privielged helper, every NSImage
returned by -getResourceValue:forKey:error: is a valid image, but the
icons are all blank.
When the process is launched from the shell (or via Xcode) as the
regular user, the returned NSImages contain the correct icons.
If the process is launched via sudo from the user's shell, the returned
NSImages are also OK.
I suspect that this is somehow a security or bootstrap context issue,
but I'll defer to expert opinion on the cause or what can be done about it.
James Bucanek
More information about the launchd-dev
mailing list