anamaria@saffron.wpd.sgi.com (Ana Maria De Alvare') (04/06/91)
Re: to umask issue Here is the original mail: --- --- Here is the test. % umask 166 % umask 166 % touch jj % ls -l jj 0 -rw------- 1 bguthy 0 Mar 30 13:55 jj % --- Here is the question. 166 EXOR 666 = 700 which should be -rwx------ Am I doing something wrong here, or is this a bug, any explanation would be helpful. ----- ----------------------------------------------------- This is my interpretation of the umask behavior Umask works as follows: The umask number is used with a 777 permission setting. If you choose umask 166 then you are stating that your execution privilege for owner should be cleared, your read/write for group and other are cleared. When you do a touch, you are creating a file that is not an executable, therefore you will get 0 -rw------- 1 bguthy 0 Mar 30 13:55 jj If at time of creation, you were creating an executable; jj would have: 0 -rw---x--x 1 bguthy 16 Mar 30 13:55 jj In other words, what umask does is to tell the system which permission bits to turn off. For example the number 2 will turn off write permission the same as number 3 does. However number 3 can turn off execute as well. ------------------------------------------------------------------------------- Ana Maria De Alvare' MTS Secure IRIX Silicon Graphics, Inc. anamaria@sgi.COM {decwrl,sun}!sgi!whizzer!saffron!anamaria 415-335-7309 -------------------------------------------------------------------------------