I admit that I have done a "chmod 777" when I should not have. Almost always that came from haste or frustration. Not frustration with Unix permissions, but frustration with whoever had daily care responsibility for the system - their inability to understand permissions might have driven me to this.
Sometimes it hardly matters. At many small businesses, everybody has "got root" anyway and has learned that this magic incantation will "fix" problems. Well, until it breaks a setuid program, of course. Nobody, NOBODY ever learns "chmod +w", do they?
Another rare breakage is /tmp. It's supposed to have the "t" bit set so that only the owners of files can delete, but I've had folks "777" it. Why? Who knows?
More usually the open permissions are applied to some common set of data. All goes well until someone removes (or just moves!) something that is needed by someone else, and then the crying starts.
The most horribly wrong things that can be done with permissions come from people who have learned about "-R" (recursive) or wild cards. Two or three times a year I find a system where someone has done a chmod to ".*". That's bad enough by itself, but when combined with -R, the results can be spectacular.
What you should understand is that this is all unnecessary. Most of us who have to deal with the results of misunderstood chmod's wish that users didn't even know that the numeric form exists. There would be far fewer errors if users only knew the symbolic modes.
The symbolic form is also much more powerful. Consider this :
$ ls -l total 0 -rw-r--r-- 1 apl apl 0 Oct 27 15:06 a -rw-r--r-- 1 apl apl 0 Oct 27 15:06 b -rwxr--r-- 1 apl apl 0 Oct 27 15:10 c $ chmod a+X a b c $ ls -l total 0 -rw-r--r-- 1 apl apl 0 Oct 27 15:06 a -rw-r--r-- 1 apl apl 0 Oct 27 15:06 b -rwxr-xr-x 1 apl apl 0 Oct 27 15:06 c
ONLY the file that was already executable had full execution bits added - try THAT with Windows!
(If you did want to change all the files, you'd use "chmod a+x a b c")
But I'm being silly. People will continue to "chmod 777" anytime they have a problem. Program doesn't work? Chmod 777. Unexpected error? Chmod 777. Grinding noise inside the computer? Chmod 777. Too hot in here? Chmod 777.
Feeling frustrated by people changing permissions for no reason? By now you should know the cure. Say it with me: Chmod 777.
Don't you feel better now?
Got something to add? Send me email.
More Articles by Anthony Lawrence © 2009-11-07 Anthony Lawrence
Whenever the literary German dives into a sentence, that is the last you are going to see of him till he emerges on the other side of his Atlantic with his verb in his mouth. (Mark Twain)