|
2 | 2 |
|
3 | 3 | tcc_db_path = '/Library/Application Support/com.apple.TCC/TCC.db'
|
4 | 4 |
|
| 5 | +tcc_db_screensharing_entry = if node['platform_version'] >= '14' |
| 6 | + "'com.apple.screensharing.agent',0,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1700100444,NULL,NULL,'UNUSED',0);" |
| 7 | + else |
| 8 | + "'com.apple.screensharing.agent',0,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1639743960);" |
| 9 | + end |
| 10 | + |
5 | 11 | execute 'authorize screensharing client to utilize the kTCCServicePostEvent service' do
|
6 |
| - command ['/usr/bin/sqlite3', tcc_db_path, "INSERT OR REPLACE INTO access VALUES('kTCCServicePostEvent','com.apple.screensharing.agent',0,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1639743960);" ] |
| 12 | + command ['/usr/bin/sqlite3', tcc_db_path, "INSERT OR REPLACE INTO access VALUES('kTCCServicePostEvent',#{tcc_db_screensharing_entry}" ] |
7 | 13 | not_if { RemoteManagement::TCC::DB.correct_privileges? }
|
8 | 14 | only_if { shell_out('/usr/sbin/system_profiler', 'SPSoftwareDataType').stdout.match?(Regexp.new('System Integrity Protection: Disabled')) }
|
9 | 15 | end
|
10 | 16 |
|
11 | 17 | execute 'authorize screensharing client to utilize the kTCCServiceScreenCapture service' do
|
12 |
| - command ['/usr/bin/sqlite3', tcc_db_path, "INSERT OR REPLACE INTO access VALUES ('kTCCServiceScreenCapture','com.apple.screensharing.agent',0,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1639743960);" ] |
| 18 | + command ['/usr/bin/sqlite3', tcc_db_path, "INSERT OR REPLACE INTO access VALUES ('kTCCServiceScreenCapture',#{tcc_db_screensharing_entry}" ] |
13 | 19 | not_if { RemoteManagement::TCC::DB.correct_privileges? }
|
14 | 20 | only_if { shell_out('/usr/sbin/system_profiler', 'SPSoftwareDataType').stdout.match?(Regexp.new('System Integrity Protection: Disabled')) }
|
15 | 21 | end
|
|
0 commit comments