[issue40198] macOS Python builds from Python.org ignore DYLD_LIBRARY_PATH due to hardened runtime

dgelessus report at bugs.python.org
Mon Apr 20 16:25:04 EDT 2020


dgelessus <dgelessus+bugs.python.org at me.com> added the comment:

I can confirm that the newly released Python 2.7.18 has the .allow-dyld-environment-variables entitlement:

$ ./python2.7 --version
Python 2.7.18
$ codesign --display --entitlements=:- python2.7
Executable=/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
<?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>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
</dict>
</plist>

and accepts DYLD_LIBRARY_PATH again:

$ DYLD_LIBRARY_PATH=tests/objc ./python2.7 -c 'import os; print(os.environ.get("DYLD_LIBRARY_PATH"))'
tests/objc

Thank you for the fix!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40198>
_______________________________________


More information about the Python-bugs-list mailing list