
Having some file permission trouble on my MacBook - files that I cannot edit/mv/etc. although I own them and permissions are 755... So, how about good ol' su?
How to Enable the "root" account on Mac OS X
The Quick CLI Method (sudo passwd root) worked fine for allowing me to su - but the root account can't seem to do anything to these files either...
To more fully describe - I have installed MAMP, and under its htdocs directory I have the roots of my local (Drupal) websites. Pretty much everything has 755 permission (rwxr-xr-x), is owned by my account which has administrative permission, and is in the staff group. I can do what I want with files in, say, /Applications/MAMP/htdocs/pathauto6 - but trying to edit and save, or rename (mv), or chgrp, or chown files in /Applications/MAMP/htdocs/pathauto6/sites/default fails with "Operation not permitted". The root account has no more luck than my own account. What's up with that?
Well, I'll tell you - the "immutable" flag was set on the folder (default). This seems to be an obscure, under-documented Mac OS X feature that overrides normal file permissions. If I'd never heard of it before (and I wasted a ridiculous amount of time tracking it down), how did it happen? My best guess is it has something to do with copying files from an NTFS-formatted external drive, which I used to transfer files from my old Windows system to my new MacBook - perhaps Windows read-only permissions get translated to the immutable flag when copying?
Comments
Handy resource
Mac OS X (Apple forum) Unix FAQ