有没有解决方法:"dtrace无法控制以受限权利签名的可执行文件"? [英] Is there a workaround for: "dtrace cannot control executables signed with restricted entitlements"?
问题描述
在OS X 10.11 El Capitan中,看来dtruss
和dtrace
不能再执行其应做的工作.这是我尝试运行sudo dtruss curl ...
时得到的错误:
It looks like in OS X 10.11 El Capitan, dtruss
and dtrace
can no longer do what they're meant to do. This is the error I get when I try to run sudo dtruss curl ...
:
dtrace:无法执行curl:dtrace无法控制以受限权利签名的可执行文件
dtrace: failed to execute curl: dtrace cannot control executables signed with restricted entitlements
我遇到了注意到这一问题的人,但到目前为止还没有解决方案.
I've come across people noticing this problem but so far no solutions.
是否可以解决此问题或解决此问题?
Is there a way to fix this or work around this?
推荐答案
一旦您csrutil enable --without dtrace
,就有一种复制二进制文件的方法:在一个Terminal窗口中运行二进制文件,并在另一个Terminal窗口中跟踪Terminal进程本身.
Once you csrutil enable --without dtrace
, there is an alternative to copying the binary: run the binary in one Terminal window and trace the Terminal process itself in another Terminal window.
在第一个终端窗口中,找到其PID:
In the first terminal window, find its PID:
$ echo $$
1154
在第二个终端窗口中,开始跟踪:
In the second terminal window, begin the trace:
$ sudo dtruss -p 1154 -f
返回,在第一个终端窗口中,运行要跟踪的过程:
Back, in the first terminal window, run the process you want to trace:
$ ls
这时,您应该在第二个窗口中看到跟踪.忽略您要跟踪的PID的条目(例如1154),其余条目用于您感兴趣的进程(及其后代).
At this point, you should see the trace in the second window. Ignore the entries for the PID you are tracing (e.g., 1154), and the rest are for the process (and its descendants) you are interested in.
1154/0x1499: sigprocmask(0x3, 0x7FFF53E5C608, 0x0) = 0x0 0
1154/0x1499: sigprocmask(0x1, 0x7FFF53E5C614, 0x7FFF53E5C610) = 0x0 0
3100/0xa9f3: getpid(0x7FFF82A35344, 0x7FFF82A35334, 0x2000) = 3100 0
3100/0xa9f3: sigprocmask(0x3, 0x10BE32EF8, 0x0) = 0x0 0
这篇关于有没有解决方法:"dtrace无法控制以受限权利签名的可执行文件"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!