Debian Codegraph @

upstream/debian-unstable/man8/pam_umask.8

raw
1 '\" t
2 .\" Title: pam_umask
3 .\" Author: [see the "AUTHOR" section]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
5 .\" Date: 06/29/2025
6 .\" Manual: Linux-PAM Manual
7 .\" Source: Linux-PAM
8 .\" Language: English
9 .\"
10 .TH "PAM_UMASK" "8" "06/29/2025" "Linux\-PAM" "Linux\-PAM Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 pam_umask \- PAM module to set the file mode creation mask
32 .SH "SYNOPSIS"
33 .HP \w'\fBpam_umask\&.so\fR\ 'u
34 \fBpam_umask\&.so\fR [debug] [silent] [usergroups] [nousergroups] [umask=\fImask\fR]
35 .SH "DESCRIPTION"
36 .PP
37 pam_umask is a PAM module to set the file mode creation mask of the current environment\&. The umask affects the default permissions assigned to newly created files\&.
38 .PP
39 The PAM module tries to get the umask value from the following places in the following order:
40 .sp
41 .RS 4
42 .ie n \{\
43 \h'-04'\(bu\h'+03'\c
44 .\}
45 .el \{\
46 .sp -1
47 .IP \(bu 2.3
48 .\}
49 umask= entry in the user\*(Aqs GECOS field (see below for details)
50 .RE
51 .sp
52 .RS 4
53 .ie n \{\
54 \h'-04'\(bu\h'+03'\c
55 .\}
56 .el \{\
57 .sp -1
58 .IP \(bu 2.3
59 .\}
60 umask= argument
61 .RE
62 .sp
63 .RS 4
64 .ie n \{\
65 \h'-04'\(bu\h'+03'\c
66 .\}
67 .el \{\
68 .sp -1
69 .IP \(bu 2.3
70 .\}
71 UMASK entry from /etc/login\&.defs
72 .RE
73 .sp
74 .RS 4
75 .ie n \{\
76 \h'-04'\(bu\h'+03'\c
77 .\}
78 .el \{\
79 .sp -1
80 .IP \(bu 2.3
81 .\}
82 UMASK= entry from /etc/default/login
83 .RE
84 .PP
85 The GECOS field is split on comma \*(Aq,\*(Aq characters\&. Entries must be set in its \*(Aqother\*(Aq (sub\-)field (the 5th field within the GECOS field), which could be done, for example, using
86 \fBchfn \-\-other\fR\&. In addition to the umask= entry, the module also recognizes the pri= entry, which sets the nice priority value for the session, and the ulimit= entry, which sets the maximum size of files the processes in the session can create\&.
87 .SH "OPTIONS"
88 .PP
89 .PP
90 debug
91 .RS 4
92 Print debug information\&.
93 .RE
94 .PP
95 silent
96 .RS 4
97 Don\*(Aqt print informative messages\&.
98 .RE
99 .PP
100 usergroups
101 .RS 4
102 If the user is not root and the username is the same as primary group name, the umask group bits are set to be the same as owner bits (examples: 022 \-> 002, 077 \-> 007)\&.
103 .RE
104 .PP
105 nousergroups
106 .RS 4
107 This is the direct opposite of the usergroups option described above, which can be useful in case pam_umask has been compiled with usergroups enabled by default and you want to disable it at runtime\&.
108 .RE
109 .PP
110 umask=mask
111 .RS 4
112 Sets the calling process\*(Aqs file mode creation mask (umask) to
113 \fBmask\fR
114 & 0777\&. The value is interpreted as Octal\&.
115 .RE
116 .SH "MODULE TYPES PROVIDED"
117 .PP
118 Only the
119 \fBsession\fR
120 type is provided\&.
121 .SH "RETURN VALUES"
122 .PP
123 .PP
124 PAM_SUCCESS
125 .RS 4
126 The new umask was set successfully\&.
127 .RE
128 .PP
129 PAM_BUF_ERR
130 .RS 4
131 Memory buffer error\&.
132 .RE
133 .PP
134 PAM_CONV_ERR
135 .RS 4
136 The conversation method supplied by the application failed to obtain the username\&.
137 .RE
138 .PP
139 PAM_INCOMPLETE
140 .RS 4
141 The conversation method supplied by the application returned PAM_CONV_AGAIN\&.
142 .RE
143 .PP
144 PAM_SERVICE_ERR
145 .RS 4
146 No username was given\&.
147 .RE
148 .PP
149 PAM_USER_UNKNOWN
150 .RS 4
151 User not known\&.
152 .RE
153 .SH "EXAMPLES"
154 .PP
155 Add the following line to
156 /etc/pam\&.d/login
157 to set the user specific umask at login:
158 .sp
159 .if n \{\
160 .RS 4
161 .\}
162 .nf
163 session optional pam_umask\&.so umask=0022
164
165 .fi
166 .if n \{\
167 .RE
168 .\}
169 .sp
170 .SH "SEE ALSO"
171 .PP
172 \fBpam.conf\fR(5),
173 \fBpam.d\fR(5),
174 \fBpam\fR(7)
175 .SH "AUTHOR"
176 .PP
177 pam_umask was written by Thorsten Kukuk <kukuk@thkukuk\&.de>\&.