hdiutil failure (bug?)

hdiutiul bug?

When making a DMG image for the whole content of user1 profile (meaning using srcFolder = /Users/user1) using hdiutil, the program fails indicating: /Users/user1/Library/VoiceTrigger: Operation not permitted hdiutil: create failed - Operation not permitted The complete command used was: "sudo hdiutil create -srcfolder /Users/user1 -skipunreadable -format UDZO /Volumes/testdmg/test.dmg" And, of course, the user had local admin rights. I was using Sonoma 14.2.1 and a MacBook Pro (Intel T2)

What I would have expected, asuming that /VoiceTrigger cannot be copied for whatever reason, would be to skip that file or folder and continue the process. Then, at the end, produce a log listing the files/folders not included and the reason for their exclusion. The fact that hdiutil just ended inmediately, looks to me as a bug. Or what else could explain the problem described?

There are some files (for example, in ~/Library there are some folders such as Calendars) for which a local user, even sudo, needs additional TCC permissions (the mechanism behind the "Do you want to allow app ... to acces your Calendar / Camera etc." type of alerts). Perhaps the -skipunreadable doesn't detect locations not accessible due to missing TCC permissions? (I need to check this).

It must be noted that TCC permissions are tied to apps. In order to be able to access, let's say, the Calendar folder from Terminal, you must give Calendar access rights to the Terminal app in System Settings.

OK, that could happened, but the problem is that hdiutil crashed, instead of ignore the file and go to the next. Anyways, /Library/VoiceTrigger seems to be related to Siri. I will test again given permission to the terminal for Siri and see what happens.

Well, I'm not sure... It could be expected behaviour, since it thinks the folder is normally accessible to the user (has at least sudo read permissions when you check with ls or stat) but MAC/TCC prevents it from reading. The man description is "skip files that can't be read by the copying user and don't authenticate". The user could read them, but the app doesn't have the necessary permissions. I'm curious about what others think as well.

I'm not sure you will find a Siri-specific setting, but you could try giving Full Disk Access to Terminal just for this command (I do not recommend keeping "Full Disk Access" on for Terminal though as all commands you will run will be able to bypass all MAC restrictions! Do this only for testing your hdiutil command once).

Giving Terminal FDA rights will most likely work, but giving FDA rights to an app / Terminal isn't recommended. If running the command with this doesn't work, you might be encountering a Data Vault, but that's unlikely.

hdiutil failure (bug?)
 
 
Q