Unmounting/ejecting volumes in sandboxed mode
Unmounting/ejecting volumes in sandboxed mode
- Subject: Unmounting/ejecting volumes in sandboxed mode
- From: Oleg Krupnov <email@hidden>
- Date: Mon, 12 Aug 2013 18:28:06 +0300
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 (email@hidden)
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:
This email sent to email@hidden