[KLUG Members] A [simple?] question

Tony Gettig members@kalamazoolinux.org
Fri, 14 May 2004 10:36:22 -0400


On Fri, 14 May 2004 09:42 , Bruce Smith <bruce@armintl.com> sent:

>> On UNIX systems generally, what determines the permission settings for 
>> a file that is newly created by a program?
>
>"umask" normally.  However a lot of programs have their own defaults.
>i.e. "cp" _may_ create a new file with the permissions of the infile.
>(depending on version of cp, Unix system, options given, ... )
>
> - BS

I can't remember the last time I went grepping through the kernel source, but
this was kind of fun. (I need to get out more.) On my SuSE 9.0, I grepped
recursively through /usr/src/linux/fs for "umask" and found lots of references.
I'm no kernel hacker, but it looks like whenever a new file is written to, on
just about any filesystem, it does make some kind of check with umask.

Let us know how this comes out, Bob. Sounds interesting!


Tony