Monday, 27 May 2013

OS X 10.8.3 root user account corrupted can su as root but not sudo

OS X 10.8.3 root user account corrupted can su as root but not sudo

I'm running into a root permissions issue on OS X 10.8.3. This is manifesting itself in various forms.
It first became clear after trying to do a self-update of MacPorts. The following issue http://stackoverflow.com/questions/15780321/macport-selfupdate-fails-code-23-xcode-command-line-tools-are-installed highlights the error seen.
XCode and the XCode command line utilities are installed and the root user is enabled.
This went on for a while and today sudo stopped working for the root user. However I can still 'su root'. I've followed all the normal resolutions. Disk Utility -> Repair Permissions, Enable/Disable the root user, change the root user p/w, power-cycle the machine. Nothing seems to fix it.
The key thing is that I also can't make changes as root as root doesn't seem to have the right permissions. I've tried chown'ing and chmod'ing anything in /etc and /etc/local but I always get "Operation not permitted"
bash-3.2$ chmod 775 base.tar
chmod: Unable to change file mode on base.tar: Operation not permitted
bash-3.2$ ls -la
total 129744
drwxr-xr-x  10 root  admin       340  8 Apr 15:17 .
drwxr-xr-x   3 root  admin       102  8 Apr 12:38 ..
-rw-r--r--   1 root  admin   9453803  8 Apr 12:30 PortIndex
-rw-r--r--   1 root  admin       512  8 Apr 12:31 PortIndex.rmd160
drwxr-xr-x  24 root  wheel       816 31 Jan 17:30 base
-rw-r--r--   1 root  admin   3594240  8 Apr 15:01 base.tar
-rw-r--r--   1 root  admin       512  8 Apr 15:01 base.tar.rmd160
drwxr-xr-x  51 root  wheel      1734  8 Apr 15:17 ports
-rw-r--r--   1 root  admin  53360640  8 Apr 15:01 ports.tar
-rw-r--r--   1 root  admin       512  8 Apr 15:01 ports.tar.rmd160
bash-3.2$ whoami
root
bash-3.2$
My /etc/sudoers also looks normal bash-3.2$ cat /etc/sudoers # sudoers file. # # This file MUST be edited with the 'visudo' command as root. # Failure to use 'visudo' may result in syntax or file permission errors # that prevent sudo from running. # # See the sudoers man page for the details on how to write a sudoers file. #
# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults specification
Defaults    env_reset
Defaults    env_keep += "BLOCKSIZE"
Defaults    env_keep += "COLORFGBG COLORTERM"
Defaults    env_keep += "__CF_USER_TEXT_ENCODING"
Defaults    env_keep += "CHARSET LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE"
Defaults    env_keep += "LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME"
Defaults    env_keep += "LINES COLUMNS"
Defaults    env_keep += "LSCOLORS"
Defaults    env_keep += "SSH_AUTH_SOCK"
Defaults    env_keep += "TZ"
Defaults    env_keep += "DISPLAY XAUTHORIZATION XAUTHORITY"
Defaults    env_keep += "EDITOR VISUAL"
Defaults    env_keep += "HOME MAIL"

# Runas alias specification

# User privilege specification
root    ALL=(ALL) ALL
%admin  ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
# %wheel    ALL=(ALL) ALL

# Same thing without a password
# %wheel    ALL=(ALL) NOPASSWD: ALL

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now
bash-3.2$
At this stage I'm considering re-installing but would prefer to fix this rather than start again.

No comments:

Post a Comment