Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

umask(2) [opensolaris 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.11 28 Dec 1996 umask(2)

Check Out this Related Man Page

UMASK(2)						      BSD System Calls Manual							  UMASK(2)

NAME
umask -- set file creation mode mask SYNOPSIS
#include <sys/stat.h> mode_t umask(mode_t cmask); DESCRIPTION
The umask() routine sets the process's file mode creation mask to cmask and returns the previous value of the mask. The 9 low-order access permission bits of cmask are used by system calls, including open(2), mkdir(2), mkfifo(2), and mknod(2) to turn off corresponding bits requested in file mode. (See chmod(2)). This clearing allows each user to restrict the default access to his files. The default mask value is S_IWGRP | S_IWOTH (022, write access for the owner only). Child processes inherit the mask of the calling process. RETURN VALUES
The previous value of the file mode mask is returned by the call. ERRORS
The umask() function is always successful. LEGACY SYNOPSIS
#include <sys/types.h> #include <sys/stat.h> The include file <sys/types.h> is necessary. SEE ALSO
chmod(2), mkdir(2), mkfifo(2), mknod(2), open(2), compat(5) STANDARDS
The umask() function call is expected to conform to IEEE Std 1003.1-1988 (``POSIX.1''). 4th Berkeley Distribution June 4, 1993 4th Berkeley Distribution
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. AIX

umask setting on a logon script

hi, am new to AIX. i have an issue. iam asked to change the umask setting on a logon script on a server to prevent writable files. i logged in as the root user and typed in umask and it displays 022, which i believe is 755 for direc and 644 for files. 1) how to I identify where the logon script... (2 Replies)
Discussion started by: karthikosu
2 Replies

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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

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