What do you do when this happens (when trying to delete the entry in database)?
“Error: stepping, attempt to write a readonly database (8)”
My try (based on @lx07 2020 post: Revoke permission to run third-party kernel extension).
(My try (is about an external SSD drive [i know how to unload/remove the kext driver, that was easy, but not to make my MacOS feel again all the reinstallation as an strange: if i reinstall the app [is a pkg], after the very first allowance, now goes all the way down without demanding the original System Preferences > Allow external developer… classic step, that i guess we all experienced many times])):
% sudo sqlite3 /var/db/SystemPolicyConfiguration/KextPolicy
Password:
SQLite version 3.37.0 2021-12-09 01:34:53
Enter ".help" for usage hints.
sqlite> SELECT * FROM kext_policy;
(NOT SHOWED ENTRY, FOR PRIVACY AND CLARITY)
(NOT SHOWED ENTRY, FOR PRIVACY AND CLARITY)
…
(NOT SHOWED ENTRY, FOR PRIVACY AND CLARITY)
8S33FS7Q5Q|com.samsung.portablessd.driver|1|Samsung Electronics|1
sqlite> DELETE FROM kext_policy_mdm WHERE team_id = '8S33FS7Q5Q';
Error: stepping, attempt to write a readonly database (8)
sqlite> DELETE FROM kext_policy WHERE bundle_id = "com.samsung.portablessd.driver";
Error: stepping, attempt to write a readonly database (8)
sqlite> SELECT * FROM kext_load_history_v3;
/Library/Extensions/….
(NOT SHOWED MAY ENTRIES, FOR PRIVACY AND CLARITY)
(NOT SHOWED MAY ENTRIES, FOR PRIVACY AND CLARITY)
…
(NOT SHOWED MANY ENTRIES, FOR PRIVACY AND CLARITY)
/Library/Extensions/SamsungPortableSSDDriver.kext|8S33FS7Q5Q|com.samsung.portablessd.driver|9DE8C72F-E1AF-4F8B-B30F-B48A1C80689B|2023-02-14 19:26:33|2023-02-14 20:46:36|53|ec8fafd76e3a5741b388e75ead49c896dfe96186
sqlite>
I read in some places on the web about changing permissions in database/s using chmod, but i wasn't feeling trusting those sources. Author of this post @lx07, looked deep competent and i would prefer his opinion.
Also the “parallel” thing:
“If you wanted to delete all of them you could use delete from kext_policy; then to be tidy delete from kext_load_history_v3; Alternatively you can delete a specific one by comparing one of the fields shown by the .schema command. For example to delete LittleSnitch based on the second field bundle_id;”.
And what about the “PRAM” component of this thing? I didn't understood well what was the point of the PRAM part. Can be avoided? Cannot?
There is always the fear of touching what should not be touched (like naively using, who knows? A chmod transforming a read-only thing [the database, for example] that should be protected read-only thinking that would be a very harmless action, but perhaps was the opposite), by just pretending revoking a very simple thing.
Thank you.