3 ms·
Sandboxed applications in OS X can read/write to arbitrary locations if they use the system Open/Save dialogs to ask the user about those files (after opting in
by ejdyksen 12y ago
Sandboxed applications in OS X can read/write to arbitrary locations if they use the system Open/Save dialogs to ask the user about those files (after opting into sandboxing, of course). See here [1].
For files and folders the user cares and knows about (documents, projects, etc), this shouldn't be a problem. For files the user doesn't care about (caches, configuration), you can just leave them in your sandboxed container.
[1] https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW17 https://developer.apple.com/library/mac/documentation/Securi...
- quotemstr 12y agoLots of applications (like Emacs and vim) don't use the system file dialogs though. It'd be nice to preserve old-fashioned file access for them.
- wtallis 12y agoAquamacs seems to use the system dialogs with no trouble.
- quotemstr 12y agoSure, File->Open invokes the system dialog. Not C-x C-f. Not automatic filename history, or tags table traversal, or perusal of the M-x grep results buffer, and so on. Emacs is a generic runtime environment and needs generic file access.
- chopin 12y agoBut these are applications for knowledgeable users I think which is not the type of users the GGP is talking about. For these it might be ok to ask for permission. Or to grant it automatically if you are root or sudo'ed. And many use cases could get around with allowing silently to write if the file has been previously been opened by the same application.
- quotemstr 12y agoI will not use a system that pops up some kind of UAC-like approval dialog for every call Emacs makes to open(2).
- wlesieutre 12y agoThe OS X sandbox doesn't work that way. If you do "Open" and pick the root of your hard drive one time, the application gets and keeps access to the entire drive. Disk scanning programs like DaisyDisk from the app store have to make you do this before they can get any information about disk usage.
- ejdyksen 12y agoWell, of course, sandboxing is opt-in, and there are still lots of programs out there that don't use them. I'm not sure Emacs or vim, as an example, would ever be able to be sandboxed from the filesystem.