On macOS 26.7.1 with Xcode 26.6 on Apple silicon, a small set of ordinary development source/resource files and one project directory carry the private extended attribute com.apple.macl. We need to create a new APFS compilation-input tree, not a filesystem backup. The proposed implementation opens source and destination objects using descriptor-relative no-follow traversal and calls fcopyfile(sourceFD, destinationFD, NULL, COPYFILE_DATA), then independently verifies exact content hashes and applies an explicit destination mode and ACL policy. It does not request COPYFILE_XATTR, COPYFILE_ACL, or COPYFILE_STAT.
Is omitting com.apple.macl supported for this data-only compilation export? Could preserving it transfer stale or inappropriate access authority to the destination? Which supported API or documented postconditions should establish the destination's correct security state? Is there an Apple-recommended procedure for exporting ordinary development source content without transferring private mandatory-access metadata?
We are seeking an API and security contract, not an interpretation of the attribute's private bytes. No production paths, source code, private attribute values, credentials, datasets, or personal information are included.
The com.apple.macl attribute is associated with macOS’s mandatory access control (MAC) subsystem, as I talk about in On File System Permissions. Whether you should copy it is a bit of a philosophical question as to the concept of what is a “file”. My only advice on that front is that you either copy it unchanged or you not copy it at all. Don’t mess around with its contents.
Oh, and I’d be remiss if I didn’t mention the <xattr_flags.h> API. This lets you query various attributes about a given extended attribute name. You can learn more about in the its man page. Notably, if you pass com.apple.macl to xattr_flags_from_name you get back a result of 0, that is, none of the flags are set.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"