UMASK(2) BSD System Calls Manual UMASK(2)NAME
umask -- set file creation mode mask
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#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 conforms to ISO/IEC 9945-1:1990 (``POSIX.1'').
BSD June 4, 1993 BSD
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)
in this unix book that i have, it says:
the statement:
filedes = open(pathname, O_CREAT, mode);
is actually
filedes = open(pathname, O_CREAT, (~mask)&mode); /* ~ is the negation symbol */
like it's doing some type of masking.
for example,
fd =... (1 Reply)
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)
A user's default permissions when creating new files or directories is set by the umask of either the system or in the startup script of the user itself. For example, I have 'umask 022' in my .profile which means that my default permissions will be 755. Typically, the system default umask is 022,... (1 Reply)
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, 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)
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)
dear all,
i'm trying to set the default permission using umask commnd. i'm using bash shell and the permission of the .bash_profile file is
-rwxr-x--- 1 tdmscrdr dba 370 Nov 7 12:21 .bash_profile
but still i'm not able to change the default permissiom.
in the .bash_profile... (1 Reply)
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)
Hi All
please help in this ..
I have application user called: startsys
umask already defined in the profile of application user as umask 033.
Actually application creating files once the file getting create it created with different permission which is not the same of the defined... (8 Replies)