Re: New File Default Permissions
From: Lew Pitcher (lpitcher@sympatico.ca)
Date: 04/10/03
- Previous message: Charles Shannon Hendrix: "Re: cleaning /tmp (was Re: How often does '\n'...)"
- In reply to: RSmith6559: "Re: New File Default Permissions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: Lew Pitcher <lpitcher@sympatico.ca> Date: Wed, 09 Apr 2003 21:53:56 -0400
RSmith6559 wrote:
> Unix creates files with default permissions rw-rw-rw- (0666).
Unix creates files with the permissions (mode bits) specified in the creat(2)
syscall executed by the program that creates the files. Typically, programs
set these mode bits to 0666, but not always. The compiler suite, for instance,
will creat(2) a.out (perhaps named differently based on compiler switches and
parameters) with 0777 modebits.
> Umask is
> logically anded with these perms resulting in what you see.
The ones complement of the process' umask value (inherited on fork(2) from the
process' parent process) is automatically anded with the mode bits specified
in the creat(2) call, giving the mode bits actually recorded in the inode.
> If the umask is
> set to 022, the resulting perms would be: rw-r--r-- (0644).
>
> Files aren't set executable by default, and really shouldn't be. If someone's
> not knowledgeable enough to change the perms so it can be executed, it follows
> that they're not knowledgeable enough to write a program.
>
> Roger
>
-- Lew Pitcher Master Codewright and JOAT-in-training Registered Linux User #112576 (http://counter.li.org/) Slackware - Because I know what I'm doing.
- Previous message: Charles Shannon Hendrix: "Re: cleaning /tmp (was Re: How often does '\n'...)"
- In reply to: RSmith6559: "Re: New File Default Permissions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|