[wplug] Win98/Linux data sharing

Tim Lesher tim at lesher.ws
Sat Apr 26 16:47:04 EDT 2003


On Sat, Apr 26, 2003 at 10:45:24AM -0700, Elwin Green wrote:
> Thanks - I know what uid and gid are; I looked up
> umask in man mount. It says this:
> 
> "Set the umask (the bitmask of the permissions that
> are not present). The default is the umask of the
> current process. The value is given in octal."
> 
> I have *no* idea what that means (Does *anyone* write
> decent documentation for non-geeks?).
> 
> How do I use umask?

If you're familiar with chmod, then you can think of the umask number
as the "opposite" of the chmod number.

UNIX permissions are usually expressed as a three-digit number.
(Technically there's a fourth digit, but it's not used in the same
way, so we'll ignore it for now).  The first digit specifies
permissions for the owner of the file; the second specifies
permissions for users in the same group as the file; the third
specifies permissions for everyone else.  You get the correct digit
for each number by adding 1 for executable, 2 for writeable, and 4 for
readable.

So a chmod of 644 means that the owner can read and write the file,
those in the same group can read the file, and anyone else can also
read the file.  A chmod of 700 means that the owner can read, write,
and execute the file, but no one else can do anything.

The umask is the opposite: it specifies what people can NOT do.  So a
umask of 022 means that the owner can do anything, but anyone else is
limited to reading.  

-- 
Tim Lesher <tim at lesher.ws>
http://www.lesher.ws




More information about the wplug mailing list