[Linux manuál]
Návod, kniha: POSIX Programmer's Manual
it shall not affect the file mode creation mask of the caller's environment.
If the mask operand is not specified, the umask utility shall
write to standard output the value of the invoking process' file mode creation
mask.
where the three values shall be combinations of letters from the set { r,
w, x}; the presence of a letter shall indicate that the
corresponding bit is clear in the file mode creation mask.
If a mask operand is specified, there shall be no output written to
standard output.
sets the mode mask so that subsequently created files have their S_IWOTH bit
cleared.
After setting the mode mask with either of the above commands, the umask
command can be used to write out the current value of the mode mask:
(The output format is unspecified, but historical implementations use the octal
integer mode format.)
Either of these outputs can be used as the mask operand to a subsequent
invocation of the umask utility.
Assuming the mode mask is set as above, the command:
sets the mode mask so that subsequently created files have their S_IWGRP and
S_IWOTH bits cleared.
The command:
sets the mode mask so that subsequently created files have all their write bits
cleared. Note that mask operands -r, -w, -x or
anything beginning with a hyphen, must be preceded by "--" to
keep it from being interpreted as an option.
it does not affect the file mode creation mask of the environment of the caller.
The description of the historical utility was modified to allow it to use the
symbolic modes of chmod. The -s option used in early proposals
was changed to -S because -s could be confused with a
symbolic_mode form of mask referring to the S_ISUID and S_ISGID bits.
The default output style is implementation-defined to permit implementors to
provide migration to the new symbolic style at the time most appropriate to
their users. A -o flag to force octal mode output was omitted because
the octal mode may not be sufficient to specify all of the information that
may be present in the file mode creation mask when more secure file access
permission checks are implemented.
It has been suggested that trusted systems developers might appreciate
ameliorating the requirement that the mode mask "affects" the file
access permissions, since it seems access control lists might replace the mode
mask to some degree. The wording has been changed to say that it affects the
file permission bits, and it leaves the details of the behavior of how they
affect the file access permissions to the description in the System Interfaces
volume of IEEE Std 1003.1-2001.
umask: získat nebo nastavit masku vytváření režimu souboru
Originální popis anglicky: umask - get or set the file mode creation maskNávod, kniha: POSIX Programmer's Manual
STRUČNĚ
umask [-S][mask]POPIS / INSTRUKCE
The umask utility shall set the file mode creation mask of the current shell execution environment (see Shell Execution Environment ) to the value specified by the mask operand. This mask shall affect the initial value of the file permission bits of subsequently created files. If umask is called in a subshell or separate utility execution environment, such as one of the following:(umask 002) nohup umask ... find . -exec umask ... \;
OPTIONS
The umask utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines. The following option shall be supported:- -S
- Produce symbolic output.
OPERANDS
The following operand shall be supported:- mask
- A string specifying the new file mode creation mask. The string is treated in the same way as the mode operand described in the EXTENDED DESCRIPTION section for chmod.
STDIN
Not used.INPUT FILES
None.ENVIRONMENT VARIABLES
The following environment variables shall affect the execution of umask:- LANG
- Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of IEEE Std 1003.1-2001, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)
- LC_ALL
- If set to a non-empty string value, override the values of all the other internationalization variables.
- LC_CTYPE
- Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).
- LC_MESSAGES
- Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
- NLSPATH
- Determine the location of message catalogs for the
processing of LC_MESSAGES .
ASYNCHRONOUS EVENTS
Default.STDOUT
When the mask operand is not specified, the umask utility shall write a message to standard output that can later be used as a umask mask operand. If -S is specified, the message shall be in the following format:
"u=%s,g=%s,o=%s\n", <owner permissions>, <group permissions>,
<other permissions>
STDERR
The standard error shall be used only for diagnostic messages.OUTPUT FILES
None.EXTENDED DESCRIPTION
None.EXIT STATUS
The following exit values shall be returned:- 0
- The file mode creation mask was successfully changed, or no mask operand was supplied.
- >0
- An error occurred.
CONSEQUENCES OF ERRORS
Default. The following sections are informative.APPLICATION USAGE
Since umask affects the current shell execution environment, it is generally provided as a shell regular built-in. In contrast to the negative permission logic provided by the file mode creation mask and the octal number form of the mask argument, the symbolic form of the mask argument specifies those permissions that are left alone.PŘÍKLADY POUŽITÍ
Either of the commands:umask a=rx,ug+wumask 002
$ umask 0002
$ umask -S u=rwx,g=rwx,o=rx
umask g-w
umask -- -w
RATIONALE
Since umask affects the current shell execution environment, it is generally provided as a shell regular built-in. If it is called in a subshell or separate utility execution environment, such as one of the following:(umask 002) nohup umask ... find . -exec umask ... \;
FUTURE DIRECTIONS
None.SOUVISEJÍCÍ
Shell Command Language , chmod , the System Interfaces volume of IEEE Std 1003.1-2001, umask()COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .| 2003 | IEEE/The Open Group |