You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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

After upgrading to ML, I am now getting this message when I try to sudo. I've repaired permissions, rebuilt the dyld cache, and removed the DYLD_LIBRARY_PATH environment variable, all with no success. Met with this message each time:


$ sudo ls

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

Password:


Any help is appreciated.


Thanks!

MacBook Pro, OS X Mountain Lion

Posted on Jul 26, 2012 8:42 PM

Reply
66 replies

Sep 26, 2012 11:09 AM in response to under400calories

Right. After paying more attention to the error, I'm thinking the only thing that is wrong is that some core system binaries were compiled with a debug flag turned on that shouldn't be.

The error can be safely ignored.

However, a system that puts out warning messages like this when nothing is wrong isn't maintainable, so it is a bug. I've noticed Mac OS has been getting better about this, on and off. Seems to take 'em a while, but spurious warnings and errors on a completely fresh, stock OS install do seem to get addressed, thankfully.

Oct 4, 2012 4:20 PM in response to fried1

Wow, I don't know how this many people have been misleading the issue. I'm very disappointed this thread even comes up so highly in search results on the internet.


Let's look carefully at the error again:


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

This particular executable (sudo in this case) has the "sticky bit" set on its file permissions (see http://en.wikipedia.org/wiki/Sticky_bit). For some reason this new Mac OS has set certain executables to with these file permissions and is throwing these warnings.


You can `chmod` these executables if you reall like and the warning will go away. Look at the executable using `ls -l` and you'll see the "s" is set there. Most other executables are set to standard 0755.


Hope that helps and this should be instructive to any of us developers to better grasp Unix fundamentals that have not changed much and are the foundation upon which most of us develop software today.

Oct 4, 2012 6:37 PM in response to Dylan Clendenin

Well people, don't do what Dylan says! You'll regret it. After doing what he recommends you can't use the sudo command anymore, and you can't get it back to the sticky bit (because you need sudo rights for that). You'll get the message: sudo: must be setuid root. If you choose to go ahead anyways, you can get the correct permissions back by going to Utilities > Disk Utility and choose "Repair Disk Permissions".

Oct 4, 2012 7:24 PM in response to Dylan Clendenin

Yes, SOME OF US need to better grasp our Unix fundamentals, like maybe YOU. Yes, let's "look very carefully" at why "for some reason sudo has its sticky bit set." Now why would a program that elevates a user to root privileges need its sticky bit set? Gee, I don't know, 5 minutes of Googling makes me a genius. Ah, ****, let's just go ahead and tell everyone to unset it and see how it goes, at the same time complaining about the ignorance of others.

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

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.