[plug] UMASK again
Mike Holland
myk at golden.wattle.id.au
Fri Jun 30 12:55:03 WST 2000
On Fri, 30 Jun 2000, Earnshaw, Mike wrote:
> UMASK is subtracted from 777 for directories and 666 for files. I can
Not really - see the umask(2) man page. The "666" is the default arg to
the open(2) system call, but a program can set whatever mode it likes.
And its a bitwise "and", not subtraction.
> -rwxr--r-- mike projman
>
> With my UMASK of 022 what has happened is 666 (file) - 022 (UMASK) =
> 644. Why does the file appear to have permissions 744?
The "umask" only removes permissions, it doesnt add them. Whatever created
the file must have requested execute permission, and the umask (quite
correctly) didnt stop it.
> Also when I issue UMASK {enter} it shows 022, I take it this is a system
> wide UMASK. How would you set a user specific UMASK?
Use the umask(1) command, which is a shell built-in. Put the command in
your .profile, or similar.
> My man UMASK does not show any info and man passwd does not appear to
> refer to it.
You should see:
# man -k umask
umask (2) - set file creation mask
umask [builtins2] (1) - bash built-in commands, see bash(1)
cheers,
Mike Holland <mike at golden.wattle.id.au>
--==--
More information about the plug
mailing list