Skip to content
EntityQ1050397· pop 12· linked from 207 articles

<!--

Key facts

Software.name
umask
Software.caption
Example of to display the current mask in different ways
Software.author
AT&T Bell Laboratories
Software.developer
Various open-source and commercial developers
Software.operating system
Unix and Unix-like
Software.platform
Cross-platform
Software.genre
Command

via Wikipedia infobox

Described at

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: 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 file mode creation mask of the invoking process. 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 . For a symbolic mode value, the new value of the file mode creation mask shall be the logical complement of the file permission bits portion of the file mode specified by the symbolic mode string. The interpretation of mode values that specify file mode bits other than the file permission bits is unspecified. In the octal integer form of mode , the specified bits are set in the file mode creation mask. The file mode creation mask shall be set to the resulting numeric value. Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( 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. The file mode creation mask was successfully changed, or no mask operand was supplied. 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. sets the mode mask so that subsequently created files have their S IWOTH bit cleared. (The output format is unspecified, but historical implementations use the octal integer mode format.) sets the mode mask so that subsequently created files have their S IWGRP and S IWOTH bits cleared. it does not affect the file mode creation mask of the environment of the caller. The default output style is unspecified 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 POSIX.1-2017.

Excerpt from a page describing this subject · 10,826 chars · not written by Vinony

Wikidata facts

Image
Umask example.png
Show 2 more facts
Sources (2)

via Wikidata · CC0

Article · Italiano

umask è un comando della shell testuale dei sistemi operativi Unix e Unix-like, e più in generale dei sistemi POSIX, che permette di suggerire ai programmi avviati successivamente quali permessi negare al momento della creazione di nuovi file e directory. Ha effetto solo per i programmi avviati successivamente ad umask, e solo se avviati dalla stessa shell, differendo da chmod sia perché quest'ultimo modifica i permessi successivamente alla creazione dei file o directory, sia perché i permessi forniti con chmod sono quelli effettivi e non quelli negati. umask è anche il nome di una chiamata di sistema definita dallo standard POSIX che modifica un omonimo attributo dei processi (precisamente del process control block), il quale mantiene il valore corrente di tale suggerimento, e che viene ereditato dai processi figli. Di fatto, il comando umask della shell, che è interno alla shell stessa e non è un programma esterno, agisce semplicemente invocando tale chiamata di sistema per modificare il valore corrente della maschera del processo della shell; il nuovo valore viene poi ereditato dai comandi avviati in seguito dalla stessa shell (ma non, ad esempio, dai comandi avviati in precedenza o avviati da altre shell). Il comando e la chiamata di sistema umask modificano solo il comportamento predefinito dei programmi, i quali mantengono la possibilità tecnica di aggirare il suggerimento, ad esempio cambiando il valore dell'impostazione corrente o modificando esplicitamente i permessi dei nuovi file e/o directory create. È possibile negare solo permessi standard di lettura, scrittura ed esecuzione, e non altri tipi di permessi.

Abstract from DBpedia / Wikipedia · CC BY-SA