I'm working on a project that works a lot with Spotlight, and we're
trying to get a list of all the attributes that Spotlight knows
about. We found a really nice function called
MDSchemaCopyAllAttributes that returns a CFArrayRef of CFStringRefs,
each one corresponding to a spotlight attribute in the schema.
The problem is that when we run this program as root (which we have
to), MDSchemaCopyAllAttributes seems to consistently be returning
nil. Is this normal behavior? If so, how can we get a list of all
Spotlight attributes across an entire machine (and not just the user
domain)?
You should be using a privileged helper process for the privileged
operations your application performs instead of running as root. There
was a great session on Authorization Services at WWDC; until the video
is up, you can take a look at:
• The Authorization Services Programming Guide: <http://developer.apple.com/documentation/security/conceptual/authorization_concepts/01introduction/introduction.html
>
• BetterAuthorizationSample: <http://developer.apple.com/samplecode/BetterAuthorizationSample/index.html#//apple_ref/doc/uid/DTS10004207
>
-Ben_______________________________________________
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com