1

This is just a curious question occurred to me yesterday while testing a program on other Macs.

When I build the program in xcode/terminal and run it, there is no warning dialog. But when I copy the executable to another Mac, there is a warning dialog.

So what specifies executable ownership and how it is detected by Mac?

smci
  • 264

1 Answers1

1

This is handled by the quarantine system in macOS. When a file is downloaded, the downloading program (browser, or whatever) attaches a special extended attribute to the file. When it's opened, Launch Services notices the quarantine attribute and applies some special security restrictions (such as the notice you're seeing).

See Apple's developer release notes for OS X v10.5 (when quarantine was introduced). You can also see the extended attribute in Terminal with ls -l@ /path/to/file; it's the "com.apple.quarantine" one. You may also see "com.apple.metadata:kMDItemWhereFroms" and "com.apple.metadata:kMDItemDownloadedDate" attributes.