Imported Upstream version 1.1.6
[platform/upstream/pam.git] / modules / pam_succeed_if / pam_succeed_if.8
1 .\"     Title: pam_succeed_if
2 .\"    Author: [see the "AUTHOR" section]
3 .\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
4 .\"      Date: 08/17/2012
5 .\"    Manual: Linux-PAM
6 .\"    Source: Linux-PAM
7 .\"  Language: English
8 .\"
9 .TH "PAM_SUCCEED_IF" "8" "08/17/2012" "Linux-PAM" "Linux\-PAM"
10 .\" -----------------------------------------------------------------
11 .\" * (re)Define some macros
12 .\" -----------------------------------------------------------------
13 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 .\" toupper - uppercase a string (locale-aware)
15 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 .de toupper
17 .tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
18 \\$*
19 .tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
20 ..
21 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 .\" SH-xref - format a cross-reference to an SH section
23 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 .de SH-xref
25 .ie n \{\
26 .\}
27 .toupper \\$*
28 .el \{\
29 \\$*
30 .\}
31 ..
32 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 .\" SH - level-one heading that works better for non-TTY output
34 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 .de1 SH
36 .\" put an extra blank line of space above the head in non-TTY output
37 .if t \{\
38 .sp 1
39 .\}
40 .sp \\n[PD]u
41 .nr an-level 1
42 .set-an-margin
43 .nr an-prevailing-indent \\n[IN]
44 .fi
45 .in \\n[an-margin]u
46 .ti 0
47 .HTML-TAG ".NH \\n[an-level]"
48 .it 1 an-trap
49 .nr an-no-space-flag 1
50 .nr an-break-flag 1
51 \." make the size of the head bigger
52 .ps +3
53 .ft B
54 .ne (2v + 1u)
55 .ie n \{\
56 .\" if n (TTY output), use uppercase
57 .toupper \\$*
58 .\}
59 .el \{\
60 .nr an-break-flag 0
61 .\" if not n (not TTY), use normal case (not uppercase)
62 \\$1
63 .in \\n[an-margin]u
64 .ti 0
65 .\" if not n (not TTY), put a border/line under subheading
66 .sp -.6
67 \l'\n(.lu'
68 .\}
69 ..
70 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71 .\" SS - level-two heading that works better for non-TTY output
72 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73 .de1 SS
74 .sp \\n[PD]u
75 .nr an-level 1
76 .set-an-margin
77 .nr an-prevailing-indent \\n[IN]
78 .fi
79 .in \\n[IN]u
80 .ti \\n[SN]u
81 .it 1 an-trap
82 .nr an-no-space-flag 1
83 .nr an-break-flag 1
84 .ps \\n[PS-SS]u
85 \." make the size of the head bigger
86 .ps +2
87 .ft B
88 .ne (2v + 1u)
89 .if \\n[.$] \&\\$*
90 ..
91 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92 .\" BB/BE - put background/screen (filled box) around block of text
93 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
94 .de BB
95 .if t \{\
96 .sp -.5
97 .br
98 .in +2n
99 .ll -2n
100 .gcolor red
101 .di BX
102 .\}
103 ..
104 .de EB
105 .if t \{\
106 .if "\\$2"adjust-for-leading-newline" \{\
107 .sp -1
108 .\}
109 .br
110 .di
111 .in
112 .ll
113 .gcolor
114 .nr BW \\n(.lu-\\n(.i
115 .nr BH \\n(dn+.5v
116 .ne \\n(BHu+.5v
117 .ie "\\$2"adjust-for-leading-newline" \{\
118 \M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
119 .\}
120 .el \{\
121 \M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
122 .\}
123 .in 0
124 .sp -.5v
125 .nf
126 .BX
127 .in
128 .sp .5v
129 .fi
130 .\}
131 ..
132 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133 .\" BM/EM - put colored marker in margin next to block of text
134 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135 .de BM
136 .if t \{\
137 .br
138 .ll -2n
139 .gcolor red
140 .di BX
141 .\}
142 ..
143 .de EM
144 .if t \{\
145 .br
146 .di
147 .ll
148 .gcolor
149 .nr BH \\n(dn
150 .ne \\n(BHu
151 \M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
152 .in 0
153 .nf
154 .BX
155 .in
156 .fi
157 .\}
158 ..
159 .\" -----------------------------------------------------------------
160 .\" * set default formatting
161 .\" -----------------------------------------------------------------
162 .\" disable hyphenation
163 .nh
164 .\" disable justification (adjust text to left margin only)
165 .ad l
166 .\" -----------------------------------------------------------------
167 .\" * MAIN CONTENT STARTS HERE *
168 .\" -----------------------------------------------------------------
169 .SH "Name"
170 pam_succeed_if \- test account characteristics
171 .SH "Synopsis"
172 .fam C
173 .HP \w'\fBpam_succeed_if\&.so\fR\ 'u
174 \fBpam_succeed_if\&.so\fR [\fIflag\fR...] [\fIcondition\fR...]
175 .fam
176 .SH "DESCRIPTION"
177 .PP
178 pam_succeed_if\&.so is designed to succeed or fail authentication based on characteristics of the account belonging to the user being authenticated or values of other PAM items\&. One use is to select whether to load other modules based on this test\&.
179 .PP
180 The module should be given one or more conditions as module arguments, and authentication will succeed only if all of the conditions are met\&.
181 .SH "OPTIONS"
182 .PP
183 The following
184 \fIflag\fRs are supported:
185 .PP
186 \fBdebug\fR
187 .RS 4
188 Turns on debugging messages sent to syslog\&.
189 .RE
190 .PP
191 \fBuse_uid\fR
192 .RS 4
193 Evaluate conditions using the account of the user whose UID the application is running under instead of the user being authenticated\&.
194 .RE
195 .PP
196 \fBquiet\fR
197 .RS 4
198 Don\'t log failure or success to the system log\&.
199 .RE
200 .PP
201 \fBquiet_fail\fR
202 .RS 4
203 Don\'t log failure to the system log\&.
204 .RE
205 .PP
206 \fBquiet_success\fR
207 .RS 4
208 Don\'t log success to the system log\&.
209 .RE
210 .PP
211 \fBaudit\fR
212 .RS 4
213 Log unknown users to the system log\&.
214 .RE
215 .PP
216
217 \fICondition\fRs are three words: a field, a test, and a value to test for\&.
218 .PP
219 Available fields are
220 \fIuser\fR,
221 \fIuid\fR,
222 \fIgid\fR,
223 \fIshell\fR,
224 \fIhome\fR,
225 \fIruser\fR,
226 \fIrhost\fR,
227 \fItty\fR
228 and
229 \fIservice\fR:
230 .PP
231 \fBfield < number\fR
232 .RS 4
233 Field has a value numerically less than number\&.
234 .RE
235 .PP
236 \fBfield <= number\fR
237 .RS 4
238 Field has a value numerically less than or equal to number\&.
239 .RE
240 .PP
241 \fBfield eq number\fR
242 .RS 4
243 Field has a value numerically equal to number\&.
244 .RE
245 .PP
246 \fBfield >= number\fR
247 .RS 4
248 Field has a value numerically greater than or equal to number\&.
249 .RE
250 .PP
251 \fBfield > number\fR
252 .RS 4
253 Field has a value numerically greater than number\&.
254 .RE
255 .PP
256 \fBfield ne number\fR
257 .RS 4
258 Field has a value numerically different from number\&.
259 .RE
260 .PP
261 \fBfield = string\fR
262 .RS 4
263 Field exactly matches the given string\&.
264 .RE
265 .PP
266 \fBfield != string\fR
267 .RS 4
268 Field does not match the given string\&.
269 .RE
270 .PP
271 \fBfield =~ glob\fR
272 .RS 4
273 Field matches the given glob\&.
274 .RE
275 .PP
276 \fBfield !~ glob\fR
277 .RS 4
278 Field does not match the given glob\&.
279 .RE
280 .PP
281 \fBfield in item:item:\&.\&.\&.\fR
282 .RS 4
283 Field is contained in the list of items separated by colons\&.
284 .RE
285 .PP
286 \fBfield notin item:item:\&.\&.\&.\fR
287 .RS 4
288 Field is not contained in the list of items separated by colons\&.
289 .RE
290 .PP
291 \fBuser ingroup group\fR
292 .RS 4
293 User is in given group\&.
294 .RE
295 .PP
296 \fBuser notingroup group\fR
297 .RS 4
298 User is not in given group\&.
299 .RE
300 .PP
301 \fBuser innetgr netgroup\fR
302 .RS 4
303 (user,host) is in given netgroup\&.
304 .RE
305 .PP
306 \fBuser notinnetgr group\fR
307 .RS 4
308 (user,host) is not in given netgroup\&.
309 .RE
310 .SH "MODULE TYPES PROVIDED"
311 .PP
312 All module types (\fBaccount\fR,
313 \fBauth\fR,
314 \fBpassword\fR
315 and
316 \fBsession\fR) are provided\&.
317 .SH "RETURN VALUES"
318 .PP
319 PAM_SUCCESS
320 .RS 4
321 The condition was true\&.
322 .RE
323 .PP
324 PAM_AUTH_ERR
325 .RS 4
326 The condition was false\&.
327 .RE
328 .PP
329 PAM_SERVICE_ERR
330 .RS 4
331 A service error occurred or the arguments can\'t be parsed correctly\&.
332 .RE
333 .SH "EXAMPLES"
334 .PP
335 To emulate the behaviour of
336 \fIpam_wheel\fR, except there is no fallback to group 0:
337 .sp
338 .if n \{\
339 .RS 4
340 .\}
341 .fam C
342 .ps -1
343 .nf
344 .if t \{\
345 .sp -1
346 .\}
347 .BB lightgray adjust-for-leading-newline
348 .sp -1
349
350 auth required pam_succeed_if\&.so quiet user ingroup wheel
351     
352 .EB lightgray adjust-for-leading-newline
353 .if t \{\
354 .sp 1
355 .\}
356 .fi
357 .fam
358 .ps +1
359 .if n \{\
360 .RE
361 .\}
362 .PP
363 Given that the type matches, only loads the othermodule rule if the UID is over 500\&. Adjust the number after default to skip several rules\&.
364 .sp
365 .if n \{\
366 .RS 4
367 .\}
368 .fam C
369 .ps -1
370 .nf
371 .if t \{\
372 .sp -1
373 .\}
374 .BB lightgray adjust-for-leading-newline
375 .sp -1
376
377 type [default=1 success=ignore] pam_succeed_if\&.so quiet uid > 500
378 type required othermodule\&.so arguments\&.\&.\&.
379     
380 .EB lightgray adjust-for-leading-newline
381 .if t \{\
382 .sp 1
383 .\}
384 .fi
385 .fam
386 .ps +1
387 .if n \{\
388 .RE
389 .\}
390 .SH "SEE ALSO"
391 .PP
392
393 \fBglob\fR(7),
394 \fBpam\fR(8)
395 .SH "AUTHOR"
396 .PP
397 Nalin Dahyabhai <nalin@redhat\&.com>