Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'You should NEVER use 777--Try 555' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
You should NEVER use 777--Try 555
Authored by: googoo on Mar 15, '04 11:46:16AM

If you check most executables in /sbin and elsewhere, the permissions are set to 555. This prevents even root from making changes without specifically enabling them.


[ Reply to This | # ]
file permissions and flags
Authored by: sjk on Mar 15, '04 06:31:19PM

There are several ways root can modify a write-protected file without changing its permissions, such as with output redirection ("echo foo > file") or with a text editor (which may prompt to overwrite read-only permission).

You can set a file's immutable flag to keep it from being modified, moved, deleted or having its permissions changed. Setting a file's system immutable flag is the most extreme because it can only be unset when the system is in single-user mode.

The Locked checkbox in a Finder Info window sets/clears the user immutable flag. The chflags command can set/clear others.

See "man chflags" and "man 2 chflags" for basic info about the different file flags.

I don't recommend using these unless you *really* understand the possible consequences.

[ Reply to This | # ]