In High Sierra and Mojave, opening a file using an app from the App Store, or any other app which runs in a sandbox, often results in a quarantine flag being written to that file. These flags aren’t necessary to open the file, and some users have found that flagged documents cause other problems, including:
- Other apps may report that the file can’t be opened, sometimes claiming conflicting permissions even though its permissions are correctly set.
- If a shell script, trying to run it may result in errors.
These flags also contain information which you may not wish to remain attached to that file, either because of the record they provide of that file being opened by a particular app at a specific time, or because those flags mount up and clutter up your file system metadata, where extended attributes are stored.
For these reasons, you may wish to remove the spurious quarantine flags written so commonly to movie, PDF, JPEG and many other file types by sandboxed apps. Here is a new utility, which runs in Sierra, High Sierra and Mojave, to do just that: Sandstrip.
It’s a single-window app and for the sake of simplicity doesn’t support drag and drop (which in this case would have quite a complex interface). To strip spurious quarantine flags from a file or the contents of a folder, click on the Strip Quarantine Flags button, select the item and click Scan.
Sandstrip then examines all the files and folders contained within the selected folder, and checks which have quarantine flags. Where it finds a quarantine flag, it examines it to see if it is one of the type written by the sandbox, LSQuarantineTypeSandboxed
, which is currently undocumented by Apple. If it is, it removes that flag completely. There is no Undo, although you could perhaps revert to an earlier APFS snapshot when available.
Once it has completely traversed the selected folder, it then writes a single-line report to its text view to tell you how many flags were stripped out of how many items that were checked, and the path of the folder examined. You can copy that into a document if you wish, and text in that view can be set in a different font and size if you prefer.
Sandstrip works very quickly indeed, but checks folders exhaustively, so for very large folders it displays a spinning busy cursor while it’s traversing the contents. You can run as many scans as you wish, then simply close the window and it quits.
Sandstrip has its own PDF Help book, also provided as its standalone documentation, and links to a new product page covering xattred and other extended attribute tools.
This first beta release is now available from here: sandstrip10b1
from Downloads above, and its product page.
Please let me know how you get on with it, particularly in Sierra – I don’t even know whether sandboxed apps set quarantine flags in Sierra – and High Sierra, which I am unable to test myself.
In testing it here, I have stripped thousands of these spurious quarantine flags, and my Mac hasn’t yet stopped working normally. Of course when you open the file in a sandboxed app again, a spurious flag will be added back, but at least it’s easy now to keep them under control.