问题描述
我注意到,如果使用权限对应用程序进行代码签名,则DYLD_INSERT_LIBRARIES
在Mountion Lion中将不再起作用.例如:
I notice that DYLD_INSERT_LIBRARIES
no longer works in Mountion Lion if the application is codesigned with entitlements. For example:
DYLD_INSERT_LIBRARIES=./mylib.dylib /Applications/Safari.app/Contents/MacOS/Safari
dyld: DYLD_ environment variables being ignored because main executeable is code signed with entitlements.
我知道这可能是Mountion Lion新增的一项安全功能.有人知道在Mountain Lion上是否有其他方法可以做类似的事情?谢谢!
I know this is probably a new security feature added to Mountion Lion.Anyone knows if there is an alternative way to do similar thing on Mountain Lion?Thanks!
推荐答案
无法使DYLD_INSERT_LIBRARIES
在这种性质的应用程序上工作.
There is no way to make DYLD_INSERT_LIBRARIES
work on applications of this nature.
dyld
在它认为受限制的应用程序上剥离所有DYLD_
环境变量,其中包括setuid/setgid二进制文件以及使用特殊权利签名的二进制文件.您可以通过查看 dyld
源.特别是,processRestricted
负责确定是否应应用限制,并且pruneEnvironmentVariables
对环境变量进行特殊处理.
dyld
strips all DYLD_
environment variables on applications it considers to be restricted, which includes setuid/setgid binaries and those signed with particular entitlements. You can see how this work by looking at the dyld
source. In particular, processRestricted
is responsible for determining whether the restrictions should be applied and pruneEnvironmentVariables
does the special handling of the environment variables.
这篇关于DYLD_INSERT_LIBRARIES不适用于在Mountain Lion上使用权利签名的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!