Erco's Mac OSX Page |
If I'm ssh(1)'ed or rsh(1)'ed in to access an AFP/SMB share, all users who didn't mount the drive get 'Permission denied', even though the perms are rwxrwxrwx for the files and dirs:
# mkdir -m 777 /smb/meade # chown sandro:sandro /smb/meade # ls -lad /smb/meade drwxrwxrwx 1 sandro sandro 16384 Jul 28 14:26 /smb/meade # mount_smbfs //fred:fred@meade/net /smb/meade # ls -lad /smb /smb/meade drwxrwxrwx 3 root wheel 102 Aug 21 2005 /smb drwxrwxrwx 1 sandro sandro 16384 Jun 2 18:48 /smb/meade # su - fred -c 'ls -la /smb/meade' -- fred can't access the directory ls: /smb/meade: Permission denied # su - sandro -c 'ls -la /smb/meade' -- only sandro and root can (but the perms are rwxrwxrwx!) [directory listing displays] |
This used to work in Panther 10.3.9 and back. When Tiger came out (10.4.0) and all updates since (as of this writing, 10.4.5), this doesn't work. Broken! Reported as a bug over 6 months ago, then closed with "works as intended". Re-opened as a bug in permissions display.
# sw_vers ProductName: Mac OS X ProductVersion: 10.4.6 BuildVersion: 8I127 # more /System/Library/StartupItems/NFS/NFS #!/bin/sh ## # Network File System ## . /etc/rc.common AUTOMOUNTDIR=/private/var/automount StartService () { CheckForNetwork if [ "${NETWORKUP}" = "-NO-" ]; then exit; fi lockfile -r 0 /var/run/NFS.StartupItem || exit 0 ## # Set up NFS client. ## echo "Starting network file system" if [ -d ${AUTOMOUNTDIR} ]; then chflags -R nouchg ${AUTOMOUNTDIR} rm -rf ${AUTOMOUNTDIR} fi [..] |
Someone reported to me they noticed this when they mounted their file system from single user mode, then brought the machine up the rest of the way, and found it running the above 'chflags' command on their mounted volume.. and it was about to run the 'rm -rf' command when he caught the problem and stopped it before it blew away his entire file server..! He logged it as a bug with Apple.
Jezus! At least check if it's a mounted drive before doing that 'rm -rf', damn!