-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defaults write
doesn't work on Safari on Mojave
#849
Comments
Same issue here |
For Safari you will have to change the command to use the property list file without the defaults write ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari AutoOpenSafeDownloads -bool true There are other property lists as well in this path.
I presume almost all apps including Apple's are going in this direction, as this is what has been done on iOS especially since 11. Apple always leaves hints regarding migrations:
|
That would've been my next attempt once I'm at my Mojave machine again. Good to know that something works. I wonder why I don't have to include that whole path for Preview.app; Also, I still think this is a bug, because |
Any updates? Moreover, I have tried each and every of @Tatsh’s suggestions, to no avail. I get either |
@Tatsh's first solution worked for me. Probably because the file in question already existed, whereas it wouldn't with an absolutely fresh user account. I'd try |
This may be caused by permissions. On Mojave Mail is blocked from apps by default. In Bash you will see this by default:
And
You need to add Bash (and maybe others like iTerm, Terminal, etc) to the Full Disk Access list. When you click +, use ⇧ + ⌘ + G to open the Go to folder dialog so you can pick items like Bash. You need to pick the exact one you are using. I am using MacPorts so everything is in Once you've done this, start a new shell (already running shells will not work) and type
|
Regarding tmux, ensure it's in the allowed apps for Full Disk Access, restart the server ( |
I can confirm that granting stuff Full Disk Access restores the correct behavior of But what a PITA!! The point of scripted setups is to not have to manually enable a bunch of stuff first. I tend to think that the full path to the containerized location is the right way to go. |
Same here, adding Terminal and bash (and also Sublime Text 3, as I test stuff from there) to Full Disk Access allowed me to set
|
On 1, I don't think it will matter but because paths can change I think it's preferable to use On 2, |
Thanks a lot for the input!
|
Right, not all apps work with the I don't know what to say about the brewed bash, but it might be relevant that what's in I used to use It should be easy to create a wrapper script that will automatically prepend the container-y path for any domain that is antecedently known to live in a container. |
Are you implying there's a way to access of those preferences without manually authorizing the aforementioned apps? (or, at least, accessing them BEFORE authorizing them).
I have noticed that ever since granting elevated permissions to bash, Terminal etc., all of the preferences are living under the non-containerized path (com.apple.Safari) again, just like they used to pre-Mojave. As far as I can see, there's no need to address the containerized path — but correct me if I'm wrong. Thanks! |
No. There used to not be a need for this, and now there is, and that's why I'm complaining. I have not noticed that everything lives where it used to. I haven't checked in a while, but last time I checked, this was not the case. The initial (failed) attempt to do |
To work around this a bit more, is anyone aware of a scriptable way to put an application into the "Full Disk Access" list? I've seen other applications add themselves into Settings -> Security & Privacy -> Privacy -> Accessibility before. Of course they are by default unchecked, but the user gets prompted to unlock and enable them, which is better than nothing. Would love to find a way to script that before running my dotfiles. |
No, as These are the services theoretically:
|
Also add shellcheck to Brewfile. Refs: mathiasbynens/dotfiles#849
I'm having a hard time keeping up with all the macOS changes. I'm attempting to allow NON-admins the ability to manipulate Privacy & Security Settings on Mojave+ using commands like: security authorizationdb write system.preferences.SecurityPrivacy allow Is there a new way? Do I need to whitelist terminal with full disk access? Any help would be much appreciated. |
using the Preferences app to enable Terminal, bash, etc somewhat defeats the automate-ability of a bootstrapping script to automate preferences. Is there a way to automate this part while maintaining SIP enabled? |
Not known at this time. Maybe I'll find a way (while keeping SIP enabled): https://github.com/Tatsh/tccx |
How can a script be made to modify the Security & Privacy settings? I can't seem to find a .plist anywhere on disk that stores these settings. How are they being persisted? |
Can't be done that way, at least not with SIP enabled. There is tccutil which can only work without SIP. There is a way to do it with configuration profiles: Configuration Profile Reference (see page 64). Example I have documented what is known about TCC here. |
@Tatsh Actually... I found a way :D Turns out that, rather than using a .plist, Apple uses a SQLite database, You can view & edit this with any software that's capable of reading/writing to SQLite db format, like JetBrains IDEs for example (as pictured below, I just opened up TCC.db within JetBrains AppCode IDE and added the main schema). Writing a script to read & write to/from this db should be pretty straightforward for anyone who knows their way around SQLite databases. |
Those files are SIP protected. The OS will know if they get modified and then restore the old version from a snapshot. |
Jeez. I wonder how Apple expects us to configure Continuous Integration nodes with Xcode etc. to work in a Jenkins pipeline? Do they expect us to log into each node individually to set these options...?? |
It seems they want you to use Apple Remote Desktop to configure whatever can't be done with CLI. |
Is anyone else noticing that using
defaults write com.apple.safari something-or-other
doesn't work on Mojave?I noticed that they seem to have moved Safari's preference plist so that it's now buried under
~/Library/Containers
(sigh). So I tried replacing "com.apple.safari
" with "-app safari
", hoping that this would pointdefaults
to the correct thing. (I found I had to do this with Preview a while back.)But alas, it doesn't work.
If it isn't just me, I'll report this to Apple. Seems like a bad bug.
The text was updated successfully, but these errors were encountered: