UMASK(2) BSD System Calls Manual UMASK(2)NAME
umask -- set file creation mode mask
SYNOPSIS
#include <sys/types.h>
#include <sys/stat.h>
mode_t
umask(mode_t numask);
DESCRIPTION
The umask() routine sets the process's file mode creation mask to numask and returns the previous value of the mask. The 9 low-order access
permission bits of numask 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.
SEE ALSO chmod(2), mkdir(2), mkfifo(2), mknod(2), open(2)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
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
Working out of AIX 4.3's .
have machine (a) and machine (b)
umask on both machines is 'umask 022'.
as user root (these are trivial machines hence dummies like me have root access) when i Ftp files from a to b , why is it that I loose the original file permissions. After the ftp I have to chmod... (1 Reply)
Hi,
I need to change my umask from 22 to 0022. FreeBSD 5.4 has different way of looking at 22 and 0022. Untill 4.11 stable 022 and 0022 were same. Can anyone help me?
Thanks in advance.
Jimmy (0 Replies)
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 All,
I am trying to ftp a file :
-rw-rw-rw- 1 oraclepbdw dba filename.txt
from Machine A ( where umask is 022) to Machine B (umask 022)
but the file changes to
-rw-rw-r-- 1 ftpamle3 ftaml filename.txt
Dur some constraints the group of the users on either side... (3 Replies)
Hi,
I have a doubt on the umask values.
Why is the UMASK value is different from file and directory?
Suppose if the umask value is 0022. The file permissions for a newly created file is 644 and the file permissions for a newly created directory is 755.
My doubt is why can't it be the... (1 Reply)
How can we set the Sticky bit in the umask itself. Please help me :confused:
I tried to set like umask 1000 but when I run umask, the value of umask is 00 (0 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)
Hi all,
The configuration:
We are useing a HP-UX Server with vxfs File System. The files on this server have normally a umask of 022 (owned by a administrative account) users who have write access to certain files get custom ACL entries that add these rights for the specific user.
Now a... (0 Replies)
Hi All,
i was reading up on a umask question on this forum and have a question on this.
the umask value on my home PC running on cygwin is 022. when i create a dir it defaults to permission 755, when i create a file it defaults to 644. Now it starts at 777 for dirs and 666 for files and... (1 Reply)