As of 2025-05-03, when a macOS user enables iCloud Drive synchronization for Desktop & Documents in US region, does iCloud filter xattrs upon upload or later when downloading back to another macOS host? Or is it the case that iCloud has no filtering of third-party xattrs? Where can I find the technical document outlining exactly what iCloud does with xattrs set on macOS host files and folders synchronized with iCloud Drive?
As of 2025-05-03, when a macOS user enables iCloud Drive synchronization for Desktop & Documents in US region, does iCloud filter xattrs upon upload or later when downloading back to another macOS host? Or is it the case that iCloud has no filtering of third-party xattrs?
So the first thing to understand here is that this isn't about iCloud itself, it's actually a general issue with xattr's and file "copying/duplication". The problem here is that xattr's aren't file data/metadata in the same way a files contents or it's name are. Some of them are being used to simply attach "data", but most of them have some special role/meaning/function within the broader system. Because of that, copying an xattr you don't "understand" can have very broad/unexpected results, particularly when you start thinking about file crossing between file systems, operating systems (and version), and intermediate layers (like network file system layers). That dynamic is why we generally don't simply preserve "all" extended attributes.
Having said that...
Where can I find the technical document outlining exactly what iCloud does with xattrs set on macOS host files and folders synchronized with iCloud Drive?
Not as such, but it turns out that what it's doing isn't actually that complicated. The issue above have been well known for a while, which why we created a (slightly awkward) system to encode how the xattr should be handled into the xattr name. You can find the API details in the man page for "xattr_name_with_flags", but that system is why many of our xattr end with "#<characters>". For something like iCloud Drive, that would mean xattr's flagged as "XATTR_FLAG_SYNCABLE". There's also an undocumented size limit of ~30kb, however, that's already significantly larger than what I'd consider "reasonable" xattr usage.
Lastly, keep in mind that the details of extended attribute support are EXTREMELY variable across the entire computing ecosystem. They can be a useful tool for solving specific problems, but I would not rely on them being preserved under "general" usage.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware