I've run across an unexpected and undocumented problem, and couldn't
google anything on it.

It seems that if an app is sandboxed, it is not permitted to eject
disks or unmount volumes.

I tried -[NSWorkspace unmountAndEjectDeviceAtPath:],
FSUnmountVolumeAsync / FSEjectVolumeAsync, DADiskUnmount / DADiskEject
but all I get is failure with a message like "Error
Domain=NSOSStatusErrorDomain Code=-47 "The operation couldn’t be
completed. (OSStatus error -47.)" (fBsyErr: File is busy (delete))"

and in Console I see "com.apple.SecurityServer[16]: Sandbox denied
authorizing right 'system.volume.internal.unmount' by client …"

The "system.volume.internal.unmount entitlement" is not documented,
and when I tried to add it to the list of entitlements, the app fails
to start at all, saying not enough permissions.

What's going on? Is there a way to eject/unmount disks in sandboxed mode?

_______________________________________________

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