Umask

Protecting your Linux box
Imran.Plus
Cadet
Posts: 12
Joined: Fri Nov 22, 2002 11:53 am
Location: Multan
Contact:

Umask

Postby Imran.Plus » Wed Dec 18, 2002 9:18 pm

Dear Friends,
What is umask, how it work and also what is it main function

Guest

Postby Guest » Fri Dec 20, 2002 8:45 am


kernel-trap
Havaldaar
Posts: 105
Joined: Thu Dec 25, 2003 2:31 pm

Postby kernel-trap » Thu Dec 25, 2003 3:45 pm

umask is basically permission given by system when creating file and directory

e.g

umask 022

file permission created 755

777 -022 = 755

LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Postby LinuxFreaK » Fri Dec 26, 2003 7:58 pm

Dear Imran.Plus,
Salam,

umask sets the umask to mask & 0777.
The umask is used by open(2) to set initial file permissions on a newly-created file. Specifically, permissions in the umask are turned off from the mode argument to open(2) (so, for example, the common umask default value of 022 results in new files being created with permissions 0666 & ~022 = 0644 = rw-r--r-- in the usual case where the mode is specified as 0666).

Best Regards.
Farrukh Ahmed


Return to “Security”

Who is online

Users browsing this forum: No registered users and 1 guest