Enable dtrace without sudo on Mac OS X?

Posted by Juan on Server Fault See other posts from Server Fault or by Juan
Published on 2010-12-22T23:46:17Z Indexed on 2010/12/23 1:56 UTC
Read the original article Hit count: 386

Filed under:
|
|
|

How do I enable users to use dtrace on Mac OS X. I am trying to do the equivalent of strace on Linux, and I don't like running applications with elevated privileges.

UPDATE

Ok, the best I can tell. The only way to keep a nefarious application from ruining the system by debugging it is to.

  1. Attach to the process in a separate console
  2. Use sudo twice

So that:

sudo dtruss sudo -u myusername potentially_harmful_app

I verified this with this short program:

#include <iostream>
#include <unistd.h>
int main()
{
  std::cout << "effective euid " << geteuid() << "\n";
}

See this discussion for more info:

http://discussions.apple.com/message.jspa?messageID=6430877

© Server Fault or respective owner

Related posts about macosx

Related posts about mac