Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

umask(2) [sunos man page]

umask(2)							   System Calls 							  umask(2)

NAME
umask - set and get file creation mask SYNOPSIS
#include <sys/types.h> #include <sys/stat.h> mode_t umask(mode_t cmask); DESCRIPTION
The umask() function sets the process's file mode creation mask to cmask and returns the previous value of the mask. Only the access per- mission bits of cmask and the file mode creation mask are used. The mask is inherited by child processes. See intro(2) for more information on masks. RETURN VALUES
The previous value of the file mode creation mask is returned. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Async-Signal-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mkdir(1), sh(1), intro(2), chmod(2), creat(2), mknod(2), open(2), stat.h(3HEAD), attributes(5), standards(5) SunOS 5.10 28 Dec 1996 umask(2)

Check Out this Related Man Page

umask(2)							System Calls Manual							  umask(2)

NAME
umask - Sets and gets the value of the file creation mask SYNOPSIS
#include <sys/types.h> #include <sys/stat.h> mode_t umask ( mode_t cmask ); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: umask(): POSIX.1, XPG4, XPG4-UNIX Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Specifies the value of the file mode creation mask. DESCRIPTION
The umask() function sets the file mode creation mask of the process to the value of the cmask parameter and returns the previous value of the mask. The cmask parameter is constructed by logically ORing file permission bits defined in the sys/mode.h header file. Whenever a file is created (by the open(), mkdir(), or mknod() function), all file permission bits set in the file mode creation mask are cleared in the mode of the created file. This clearing lets users restrict the default access to their files. The mask is inherited by child processes. RETURN VALUES
Upon successful completion, the previous value of the file mode creation mask is returned. RELATED INFORMATION
Commands: chmod(1), mkdir(1), Bourne shell sh(1b), POSIX shell sh(1p), umask(1) Functions: chmod(2), mkdir(2), mknod(2), open(2), stat(2) Standards: standards(5) delim off umask(2)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

umask

the umask on solaris must return 022 or 0022 wich one is correct and why? thanks, pa (2 Replies)
Discussion started by: rsh
2 Replies

2. AIX

list of default umask by user

Hi, Do you know if it's possible to have the user list with their umask on AIX system ? I need to check if they are OK but with smit and user by user, it will take all the day. :) An idea ? Thx a lot. (3 Replies)
Discussion started by: Zlikos
3 Replies

3. UNIX for Advanced & Expert Users

Selective Umask

Hi, We have umask 022 in /etc/profile for security reasons. But I want have some other umask for selected users. how to achieve this? Regards (3 Replies)
Discussion started by: baanprog
3 Replies

4. Shell Programming and Scripting

umask with find

Hi, Will umask work with find command ? I was trying to do find /newdir/apps/ -type d -name 'par' -print -exec umask 117 {} \; it returns with find: umask: Permission denied , I've checked permission of all the directores, they have 770. however, If I use the command find... (4 Replies)
Discussion started by: braindrain
4 Replies

5. Linux

help on umask

hai guys , i am having problem in getting the knowledge about umask. actually when i am putting command as umask some value is coming like 0022 by defalut. we can change its value also. but the main thing is thye file permisiion actually depends upon umask.how is it depends upon umask i want to... (6 Replies)
Discussion started by: suvendu4urs
6 Replies

6. UNIX for Dummies Questions & Answers

Unmask

Hi All, I'm a newbie to UNIX I'm learning AIX 5l Basics I'm unable to execute UNMASK command as mentioned. Could any one help me. (6 Replies)
Discussion started by: udayakumar
6 Replies

7. UNIX for Dummies Questions & Answers

How can we set the Sticky bit in the umask itself

How can we set the Sticky bit in the umask itself. Please help me :confused: (3 Replies)
Discussion started by: geniman2004
3 Replies

8. UNIX for Advanced & Expert Users

file creation

Hi, Is there any way to restrict directories with one type of file creation. regards. (8 Replies)
Discussion started by: guguli
8 Replies

9. Ubuntu

/etc/bashrc umask

Hi, I got this redhat ent 4 assigned to me now. /etc/bashrc if ; then umask 022 else umask 077 fi What does it mean? I created already three user and it never had 022 umask, always 077. Thank you in advance. (3 Replies)
Discussion started by: itik
3 Replies

10. Shell Programming and Scripting

umask : improper mask

Dear Guru, I see the result after I run the script as below I don't know what does it mean so please explain to me. Thanl in advance (2 Replies)
Discussion started by: unitipon
2 Replies

11. HP-UX

Problem With exceutable file creation

Hello , I came up with a new problem during creation of an exceutable file. My application all the c files and links them to create a new executable file. Till last month everything was fine and yester day i tried to change one file and tried to create an exe file but unsuccesfull. I am... (8 Replies)
Discussion started by: jagan_kalluri
8 Replies

12. Solaris

umask

Due to urgent requirement to resolve some permission issues , I wish to set solaris 8 server so that any file written is on 777 . I guess need to set umask , how to set it ?? (7 Replies)
Discussion started by: falcon16
7 Replies

13. UNIX for Advanced & Expert Users

umask

Hi, Please, let me know how the umask is working? As per my understanding is aprt from subtracting from 666/777, logical gate operation is performing. Ex: If I set uname 011, it gave the permission like 666 for file. Request you to explain which gate's operation performed. $uname 011... (4 Replies)
Discussion started by: Nagapandi
4 Replies

14. UNIX for Dummies Questions & Answers

Monitoring umask execution

Good Day! I would like to ask, is there a way to find out the list of users or scripts that executed a umask command for a given time? Our server has been having issues about files being written with 000 access, and we need to find out if it's because someone or some code is playing around with... (4 Replies)
Discussion started by: mike_s_6
4 Replies

15. UNIX for Dummies Questions & Answers

How to calculate umask values?

Hi, I was trying to understand how to calculate umask value but couldnt get the right way to calculate it. can some one please give me a small formula or easy method to do it? Thanks, Waseem (4 Replies)
Discussion started by: ahmedwaseem2000
4 Replies