Hello Niels,
On Tue, Mar 31, 2020 at 09:27:02AM +0200, Niels Möller wrote:
In a quick test on Mojave it appears that any attempt to setenv() a variable that starts with DYLD_ is silently ignored. Can you confirm that? My testcase is:
DYLD_FOO=foo DLYD_FOO=bar bash -c 'echo $DYLD_FOO $DLYD_FOO'
from which I get only 'bar' and no 'foo'.
Odd. I hope it's still possible to set DYLD_LIBRARY_PATH to a valid absolute name of a directory?
No, unfortunately it's not. Any attempt to set an environment variable whose name starts with DYLD_ seems to be ignored. It doesn't matter if you're a normal, admin or the root user either. It appears to be caused by SIP (System Integrity Protection):
https://github.com/nasa/europa/issues/181
And indeed on another system where I have SIP disabled, exporting DYLD_-variables works as expected with above test case. dyld even prints a warning that it doesn't know variable DYLD_FOO.