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