Help pls. What have I done? /usr/bin/sudo

Discussion in 'macOS' started by sunshinee27, Aug 21, 2013.

  1. sunshinee27 macrumors newbie

    Joined:
    Aug 21, 2013
    #1
    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.
     
  2. ScoobyMcDoo macrumors 65816

    Joined:
    Nov 26, 2007
    Location:
    Austin, TX
    #2
    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.
     
  3. sunshinee27 thread starter macrumors newbie

    Joined:
    Aug 21, 2013
    #3
    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?
     
  4. ElectricSheep, Aug 22, 2013
    Last edited: Aug 22, 2013

    ElectricSheep macrumors 6502

    ElectricSheep

    Joined:
    Feb 18, 2004
    Location:
    Wilmington, DE
    #4
    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
    
     
  5. Fishrrman macrumors G3

    Joined:
    Feb 20, 2009
    #5
    "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!"
     
  6. Tpruitt macrumors newbie

    Joined:
    Apr 9, 2013
    #6
    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?
     
  7. blewvelvet macrumors newbie

    Joined:
    Apr 22, 2009
    #7
    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?
     

Share This Page