Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid

since an update to 10.8 I get the following error, when trying to do a sudo command, which is pretty annoying.

dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid

What does that have to mean? I hope anyone can help.

like image 884
eneskaya Avatar asked Aug 22 '12 00:08

eneskaya


2 Answers

This seems to be a bug introduced in 10.8, see this report. As far as I can tell, the only workaround is not setting DYLD_LIBRARY_PATH or LD_LIBRARY_PATH by default, but only when needed.

like image 105
Erik Hesselink Avatar answered Sep 18 '22 17:09

Erik Hesselink


In zsh:

sudo () { ( unset LD_LIBRARY_PATH DYLD_LIBRARY_PATH; exec command sudo $* ) }

This spawns a sub-shell in which the environment variables sudo complains about are unset, and then executes sudo (via exec so that the now-unecessary parent shell exits immediately).

I'll leave it as an exercise to the reader to port to bash, et al.

like image 20
Pinko Avatar answered Sep 19 '22 17:09

Pinko