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