NEED HELP UNDERSTANDING UMASK.

From: Shel Sherman (ssherm32_at_sbcglobal.net)
Date: 07/22/05


Date: Fri, 22 Jul 2005 13:39:39 GMT

I need help in understanding the following use of umask.

I ran several values of umask, created empty files using "touch" called
foo1, foo2, etc. and
 looked at the resulting permissions via ls -l for each value of umask. The
results are tabulated
below. Some results were as expected. Others leave me scratching my head.

UMASK RESULT OCTAL EQUIV. EXPECTED
0022 rwxr_xr_x 755 yes
0777 --------- 000
yes
 0321 r__r__rw_ 446 NO
0210 r__rw_rw_ 466 NO
0111 rw_rw_rw_ 666 yes
0123 rw_r__r__ 644 NO

Note that three of the six masks used did not yield the expected results.
For example, using a mask
of 0321 (octal) and then creating an empty file I expected to find the
permissions as
r _ _ r _ x r w _. Instead what I got was r _ _ r _ _ r w _ which
corresponds to 446 instead of the expected 456.

So I remain.....confused. Help would be appreciated.

Shel Sherman



Relevant Pages

  • Re: File Sharing (again - sorry, Pd)
    ... InTerminal, type umask. ... Back in the good old days, Mac OS X user accounts ... The reason that the file permissions are "resetting" each time the ... that folder inherit the ACLs from the folder. ...
    (uk.comp.sys.mac)
  • Re: umask?
    ... setgid permissions used on your files and directories. ... the default umask value set on your system to 027, ... The shell does simple maths to determine what permissions are used on ... On a directory the maximum permissions will be drwxrwxrwx. ...
    (Fedora)
  • Re: [patch 12/13] ACL umask handling workaround in nfs client
    ... >> the umask locally, and sends the effective permissions to the server. ... >> only the default ACL determines the file's effective permissions. ...
    (Linux-Kernel)
  • Re: File Permissions problem : Cry for HELP
    ... is something wrnog with the server cause when i upload the same files from ... >> i have a problem with file permissions, each new file i need to create i ... >> Internal Server Error ... > You need to change the umask used when you are saving web files. ...
    (Fedora)
  • Re: default permissions when scping files
    ... >> username take on specific permissions, or barring that, ... I read it to mean that the umask does not affect the execute bit of files ... as the source file has. ...
    (comp.unix.shell)