Re: Suggestions for handling old document files with file paths in a sandbox environment
Re: Suggestions for handling old document files with file paths in a sandbox environment
- Subject: Re: Suggestions for handling old document files with file paths in a sandbox environment
- From: Quincey Morris <email@hidden>
- Date: Wed, 03 Oct 2012 14:33:08 -0700
On Oct 3, 2012, at 14:02 , Marshall Houskeeper <email@hidden> wrote:
> I have no problem with the use of the open panel ( security-scoped bookmark )for creating new documents.
OK, understood.
> The problem is for pre sandboxed documents or documents that come from Windows. Having the user re-authorize each external file would be very problematic and time consuming.
Putting the two halves of what I said together, the question is how many uses of the open panel (or Windows equivalent) did it originally take to produces these older documents? Thousands?
My guess is not thousands -- thousands of files may be referenced, but there were many fewer "add" operations involved (either because the user added a folder, or added one file which implied the locations of other files).
It seems to me you'd need to reduce the thousands of files references to a much smaller number of re-constructed "user-did-add" operations which would, yes, have to be individually reauthorized. This would, in many case, mean you were creating bookmarks for enclosing folders rather than files.
> What I am looking for are suggestions to best handle or avoid the re-authorization of each embedded file reference. One option may be to write a non sandbox application that would take the non sandboxed document and convert the file references to security-scoped bookmarks if this is allowed.
I don't believe it's possible. If it were, sandbox security could easily be bypassed by malicious software.
If there's no practical way to reduce the re-authorizations to a manageable number, then I think you must follow Sean's suggestion of getting a temporary entitlement for your app that allows it to read anywhere in the file system, using the need for compatibility with older documents as your reason. You *might* in this case be able to "convert" older documents to use security-scoped bookmarks, under the aegis of the temporary entitlement, but I admit I don't know whether there are constraints on bookmarks in this case. (It also means your users will need to convert their old documents before the temporary entitlement is deprecated sometime in the future, as I'm sure it will eventually be.)
_______________________________________________
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