DYLD_INSERT_LIBRARIES doesn't work for app signed with entitlements on Mountain Lion

前端 未结 1 594
执笔经年
执笔经年 2021-01-18 09:21

I notice that DYLD_INSERT_LIBRARIES no longer works in Mountion Lion if the application is codesigned with entitlements. For example:

DYLD_INSER         


        
相关标签:
1条回答
  • 2021-01-18 09:47

    There is no way to make DYLD_INSERT_LIBRARIES work on applications of this nature.

    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.

    0 讨论(0)
提交回复
热议问题