Re: New File Default Permissions

From: Lew Pitcher (lpitcher@sympatico.ca)
Date: 04/10/03

  • Next message: Damien Metzler: "Parmeter expansion"
    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.
    

  • Next message: Damien Metzler: "Parmeter expansion"

    Relevant Pages

    • Re: New File Default Permissions
      ... Unix creates files with default permissions rw-rw-rw-. ... logically anded with these perms resulting in what you see. ... If the umask is ...
      (comp.unix.shell)
    • Re: Using .Connect to relink fails! Really need help with this!
      ... When you say the front end grants all users all permissions on all "tables", ... had on the linked-to tables. ... > Backend has all table perms revoked for all but admin users. ... > The first error must indicate that the one all perms ok table link ...
      (microsoft.public.access.security)
    • Re: HELP! cant become root
      ... I got my fonts back by giving the correct permissions to my home ... Or reinstall a bunch of packages in hopes that it fixes up the ... If it fixes the perms, ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)
    • Re: quick file sharing question
      ... Going back and checking the share setup I have, you are correct in stating the share perms are only 3 types. ... You write "Share permissions have the same functionality ... individual files and folders within that share. ... NTFS permissions can be set for a whole tree or for any file ...
      (microsoft.public.windows.server.general)
    • Re: "Sending From:" confusion.
      ... I'll look into clearing the Domain Admins permissions. ... When I give her SEND AS perms the email is sent with "From: ... I don't have myself set up with SEND AS perms for this user account, ...
      (microsoft.public.exchange.admin)