Hi, I upgraded to mountain lion today, but still seeing this problem.
I came up with a temporary work around may be slightly better than just turning off DYLD_* vairables. In my case, DYLD_* variables are set for some minor programs that doesn't require `sudo' privillage; so I can safely unset DYLD_* before sudo, and restore them after finishing the sudo jobs. And i got a little script to do this:
in your .profile/.bashrc/.bash_profile (depends on you terminal setting):
# set DYLD_* for my normal programs
DYLD_LIBRARY_PATH='..'
# set an alternative sudo
thesudo()
{
# back up the DYLD_* variables
local BACK=$DYLD_LIBRARY_PATH
# unset DYLD_*
unset DYLD_LIBRARY_PATH
# calling sudo
/usr/bin/sudo "$@"
# restore DYLD_* after sudo finished
export DYLD_LIBRARY_PATH=$BACK
}
# redirect sudo
alias sudo=thesudo
In this way, sudo cannot access my customised DYLD_* paths, but at least other programs can. And if a program requires privallage to run with private library, i can always put those libraries under the standard library path /usr/lib. After all if the library is unsafe, you'd better only keep it to normal programs and set the DYLD_ paths to run them.