iCloud Recovery Contacts can't be read or modified when home directory is located on external drive
- macOS Version: Sonoma 14.6.1 (23G93)
- Hardware: M1 Mac Studio
- Other context: SIP disabled, home folder located at /Volumes/NVME/Users/squash
If your home directory is located on an external drive, it appears a sandboxing issue prevents appleaccountd from writing files to ~/Library/com.apple.appleaccountd.
This leads to a number of issues, including:
- getting constant UI notifications to "Update your recovery contacts"
- System Settings > iCloud > Advanced Data Protection > Account Recovery > Set Up... pane fails to load existing recovery contacts and doesn't let you add new ones "Unable to Add Recovery Contact"
- Lots of permissions errors in Console.app whenever you do try to change recovery contacts (see below)
Failed to save record <redacted> with error: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “<redacted>” in the folder “CustodianRecord”." UserInfo={NSURL=file:///Volumes/NVME/Users/squash/Library/com.apple.appleaccountd/CustodianRecord/<redacted>, NSUserStringVariant=Folder, NSUnderlyingError=0x121b0d8d0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
Error adding record to LocalCache: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “<redacted>” in the folder “CustodianRecord”." UserInfo={NSURL=file:///Volumes/NVME/Users/squash/Library/com.apple.appleaccountd/CustodianRecord/<redacted>, NSUserStringVariant=Folder, NSUnderlyingError=0x12180d770 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
Failed to delete <redacted> with error: Error Domain=AACustodianErrors Code=-7003 "(null)"
It seems it's able to create the folder structure in ~/Library/com.apple.appleaccountd but when it tries to write/delete any files it fails with a 513 permissions/sandbox error.
The entitlements on /usr/libexec/appleaccountd show that it should have write permissions to that dir:
<key>com.apple.security.exception.files.home-relative-path.read-write</key>
<array>
<string>/Library/com.apple.appleaccountd/</string></array> ...
So I think it's a bug related to how that entitlement is handled for certain atomic writes when the User's home folder is on an external volume. Maybe the same underlying cause as this issue:
https://github.com/swiftlang/swift-package-manager/issues/6948#issuecomment-1747196926
I tried disabling SIP + giving the appleaccountd, AppleIDSettings, and cloudd binaries "Full Disk Access" in System Settings as a hack to give them write access with no luck.
Does anyone know how to fix this or how to temporarily run appleaccountd with no quarantine/MAC/entitlement restrictions?
Mac Studio