1

I was using gdb recently on my Mac and I was annoyed with the incessant popup which always shows up when I try to use gdb:

enter image description here

I read on StackOverflow that you can make this popup go away with the following incantation:

$ sudo security authorizationdb write system.privilege.taskport allow

It seems to have worked, but now that I'm done with gdb for the time being, I thought maybe it'd be a good idea to reset this authorization rule back to its default value. But, upon inspecting man security I see no way to do this. Is it even possible, and if so, how?

2
  • 1
    Try the same command, but use 'rule' instead of 'allow'. The StackOverflow post indirectly mentions this in Emily's answer.
    – IconDaemon
    Commented May 15, 2018 at 19:16
  • 1
    @IconDaemon Trying that gives this very uninformative message: NO (-60005)
    – GDP2
    Commented May 15, 2018 at 23:51

1 Answer 1

1

The following is the default value for the "system.privilege.taskport" key on macOS Ventura 13.3.1:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>allow-root</key>
    <false/>
    <key>authenticate-user</key>
    <true/>
    <key>class</key>
    <string>user</string>
    <key>comment</key>
    <string>Used by task_for_pid(...).
        Task_for_pid is called by programs requesting full control over another program
        for things like debugging or performance analysis. This authorization only applies
        if the requesting and target programs are run by the same user; it will never
        authorize access to the program of another user.  WARNING: administrators are advised not to modify this right.</string>
    <key>created</key>
    <real>557959080.243554</real>
    <key>group</key>
    <string>_developer</string>
    <key>modified</key>
    <real>557959080.243554</real>
    <key>session-owner</key>
    <false/>
    <key>shared</key>
    <true/>
    <key>timeout</key>
    <integer>36000</integer>
    <key>tries</key>
    <integer>10000</integer>
    <key>version</key>
    <integer>0</integer>
</dict>
</plist>

Save the above to a file, named say "taskport-default.plist", then run:

sudo security authorizationdb write system.privilege.taskport < taskport-default.plist

You should then receive in the prompt:

YES (0)

If you want to double check this was applied properly, you can run the following:

sudo security authorizationdb read system.privilege.taskport 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .