Bill Jonas on Wed, 26 Jun 2002 13:19:33 -0400 |
On Wed, Jun 26, 2002 at 12:41:15PM -0400, Jesse Schultz wrote: > Arthur S. Alexion wrote: > | Are you saying that umask=000 is like doing a chmod 777? > Yes, that is my understanding and it seems to work. See bash(1)'s discussion of its umask command and umask(2) for more details. Basically, you specify which bits of the permissions you *don't* want set by default on new files. Go ahead, enter the command "umask" now; it'll probably say "022" or "0022" or something similar. Touch a non-existant file; note that it's created (assuming your umask is 022) mode 644. Change your umask to 077 (enter "umask 077") and touch another non-existant file. Note that it's created mode 600. This is because /usr/bin/touch creates the file with mode 666, which is then filtered through your shell's umask. (Well, technically, it inherits your shell's umask and doesn't change it. It could, if it wanted, change its own (by that, I mean the process') umask, but that's considered fairly rude for a program to do unless it has good reason, like GnuPG, ssh, or Mozilla would, for example. Polite behavior is usually to create files with mode 666 and let the user's umask determine what the actual permissions will be.) The umask argument to mount works in a similar fashion. -- Bill Jonas * bill@billjonas.com * http://www.billjonas.com/ "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin Attachment:
pgphl177UIfE1.pgp
|
|