univ-of-utah-marriott-library-apple / privacy_services_manager

A single management utility to administer Location Services, Contacts requests, Accessibility, and iCloud access in Apple's OS X.
MIT License
126 stars 10 forks source link

"accessibility" option fails as root #8

Closed TGBX closed 10 years ago

TGBX commented 10 years ago

The "accessibility" option requires root, as noted in the doco.

Error: ValueError: Must be root to modify 'accessibility'

However, when it is run as root, an error is generated about creating a TCC database for the root user, rather than modifying the Local (/Library) TCC database as root, and the process fails.

$ sudo /usr/local/bin/privacy_services_manager.py enable accessibility /Applications/Evernote.app
Error: ValueError: Will not create a TCC database file for root.

Creating a TCC database for the root user is generally not helpful, and
there is really no good reason to do it.

If you intended to change the permissions for a particular user as root,
instead use the `--user` option. For example:

privacy_services_manager.py --user "username" add contacts com.apple.Safari

If you really want to create a TCC database file for root, run the
command with the `--forceroot` option:

privacy_services_manager.py --forceroot add contacts com.apple.Safari

The Local (/Library/Application Support/com.apple.TCC) database has not been modified:

$ date
Mon  3 Nov 2014 11:38:00 AEDT
$  ls -al /Library/Application\ Support/com.apple.TCC/TCC.db 
-rw-r--r--  1 root  admin  36864 10 Oct 10:45 /Library/Application Support/com.apple.TCC/TCC.db

This also occurs if the bundle ID is used rather than a path.

$ sudo /usr/local/bin/privacy_services_manager.py add accessibility com.evernote.Evernote
Error: ValueError: Will not create a TCC database file for root

For reference, tcc_database_manager (I realise it's deprecated):

$ sudo tcc_database_manager -n add accessibility /Applications/Evernote.app
2014-11-03 11:58:10,687 INFO: Found bundle IDs: ['com.evernote.Evernote']
2014-11-03 11:58:10,690 INFO: Adding 'com.evernote.Evernote' to accessibility service.

Using: Privacy Services Manager, version 1.4.2 Management Tools, version 1.5.13

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.9.5
BuildVersion:   13F34
pdarragh commented 10 years ago

Hello @TGBX,

I just released an update with commit 6bc5a7c, which I have tested and it solves this problem. Sorry about the trouble there! I guess I just didn't check everything thoroughly enough last time. Thanks for catching that!

Pierce

pdarragh commented 10 years ago

I also updated the releases page with a new installer package.