Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sunshinee27

macrumors newbie
Original poster
Aug 21, 2013
2
0
Hello!

My terminal kept getting this error: "dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/login) is setuid or setgid"

So I tried finding solution online and I found people with the same error and they solved it by this:

sudo sh
<password entered; results in superuser prompt - #>
mv /usr/bin/sudo /usr/bin/sudo-real

cat > /usr/bin/sudo
#!/bin/sh

SUDO=/usr/bin/sudo-real

exec $SUDO $* 2>> /dev/null #Normal users can't write to /var/log/sudu-wrapper-output


^C
sh-3.2# chmod +x /usr/bin/sudo

https://discussions.apple.com/thread/4143805?start=45&tstart=0

I am a noob and I don't understand what any of these commands mean.

Now when I type sudo in terminal, I kept getting "-bash: /usr/bin/sudo: Permission denied". And the error I got before about DYLD is still there. Please help me. How do I fix this? D:At least how to get the sudo permission back.
 

ScoobyMcDoo

macrumors 65816
Nov 26, 2007
1,188
37
Austin, TX
Looks like you got some bad advice. So first you should undo the stuff you did with sudo:

Code:
sudo-real rm /usr/bin/sudo
sudo-real mv /usr/bin/sudo-real /usr/bin/sudo

Now open the disk utility and repair disk permissions. Hopefully this will help with the original problem. If not, post back and we can try to help from there.
 

sunshinee27

macrumors newbie
Original poster
Aug 21, 2013
2
0
Looks like you got some bad advice. So first you should undo the stuff you did with sudo:

Code:
sudo-real rm /usr/bin/sudo
sudo-real mv /usr/bin/sudo-real /usr/bin/sudo

Now open the disk utility and repair disk permissions. Hopefully this will help with the original problem. If not, post back and we can try to help from there.

Thank you, ScoobyMcDoo! I finally got the sudo command working with the code you provided. :D
After performing the repair disk permission, terminal still shows the dyld error. Are there any commands to get rid of it as well?
 

ElectricSheep

macrumors 6502
Feb 18, 2004
498
4
Wilmington, DE
Check the contents of your .profile file to see if there are any exports to the DYLD_* environment variables:

Code:
less ~/.profile

You can also other files which are capable of setting environment variables:

Code:
less /etc/profile
less ~/.MacOSX/environment.plist
less /etc/launchd.conf
 
Last edited:

Fishrrman

macrumors Penryn
Feb 20, 2009
28,348
12,464
"I am a noob and I don't understand what any of these commands mean."

MacConfucius say:
"Noobs who play with terminal commands without understanding what they mean, may end up with nothing!"
 

Tpruitt

macrumors newbie
Apr 9, 2013
1
0
my mac terminal gives this message "dyld: dyld_ environment variables being ignored because main executable (/usr/bin/login) is setuid or setgid" can u help me?
 

blewvelvet

macrumors member
Apr 22, 2009
31
0
Same Problem

I have the same issue. No sudo commands allowed and the I get this everytime I open terminal.

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

The only file that opened was the "less ~/.MacOSX/environment.plist"


Result
--------------------
# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
/etc/profile (END)
-------------------------------

What does this mean?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.