root unable to read/access specific files and extended attribute

I'm the author of a backup utility. In our testing with Mojave, we've discovered a handful of files, directories, and extended attributes that can't be read ... even by root.


Specifically,


Cannot read the following files:

/Library/Preferences/com.apple.TimeMachine.plist

/Users/amber/Library/Preferences/com.apple.AddressBook.plist


Cannot read the extended attributes of the following items:

/Library/Application Support/com.apple.TCC

/Users/amber/Library/Application Support/AddressBook

/Users/amber/Library/Calendars

/Users/amber/Library/Safari

/Users/amber/Library/Suggestions

/Users/amber/Library/PersonalizationPortrait

/Users/amber/Library/Cookies


In all cases, the error returned was 1 (EPERM, "Operation not permitted").


(a) Is the expected behavour for Mojave?


(b) Is this documented somewhere (I couldn't find any mention of this in the release notes)


(c) Is there a way around this?

Replies

Yes, this is due to the new Privacy Protection that is introduced with macOS 10.14 Mojave:

https://developer.apple.com/videos/play/wwdc2018/702/


Your app will proably need Full Disk Access (FDA) in order to work properly. Unfortunately there seems no API to request or even check for FDA.


You will propably have to build a helper that guides the User through the System Preferences to grant your app FDA.

I watched the video on the new privacy policies, but it still isn't solving my issue.


I tried adding my application and my helper binary to the Full Disk Access security category, and it still can't read any of those files/directories.


Am I missing something, or is this a (reportable) bug?

Update: The situation is a little better now. I was able to build against 10.14 SDK and add my helper executable to the Full Disk Access group in Security & Privacy preference pane.


However, my process still can't access these two items:


/Library/Application Support/com.apple.TCC

/Library/Preferences/com.apple.TimeMachine.plist


I will also note that the video shows Xcode's "Hardened Runtime" capabilities options includes an "All Files" access entitlement. But the current Xcode beta 6 does not include this option.

Filed bug #44389859