1 <?xml version="1.0" encoding='UTF-8'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
6 <refentry id='pam_succeed_if'>
7 <!-- Copyright 2003, 2004 Red Hat, Inc. -->
8 <!-- Written by Nalin Dahyabhai <nalin@redhat.com> -->
11 <refentrytitle>pam_succeed_if</refentrytitle>
12 <manvolnum>8</manvolnum>
13 <refmiscinfo class='sectdesc'>Linux-PAM</refmiscinfo>
16 <refnamediv id='pam_succeed_if-name'>
17 <refname>pam_succeed_if</refname>
18 <refpurpose>test account characteristics</refpurpose>
23 <cmdsynopsis id='pam_succeed_if-cmdsynopsis'>
24 <command>pam_succeed_if.so</command>
25 <arg choice='opt' rep='repeat'><replaceable>flag</replaceable></arg>
26 <arg choice='opt' rep='repeat'><replaceable>condition</replaceable></arg>
31 <refsect1 id='pam_succeed_if-description'>
32 <title>DESCRIPTION</title>
34 pam_succeed_if.so is designed to succeed or fail authentication
35 based on characteristics of the account belonging to the user being
36 authenticated. One use is to select whether to load other modules based
41 The module should be given one or more conditions as module arguments,
42 and authentication will succeed only if all of the conditions are met.
46 <refsect1 id="pam_succeed_if-options">
47 <title>OPTIONS</title>
49 The following <emphasis>flag</emphasis>s are supported:
54 <term><option>debug</option></term>
56 <para>Turns on debugging messages sent to syslog.</para>
60 <term><option>use_uid</option></term>
63 Evaluate conditions using the account of the user whose UID
64 the application is running under instead of the user being
70 <term><option>quiet</option></term>
72 <para>Don't log failure or success to the system log.</para>
76 <term><option>quiet_fail</option></term>
79 Don't log failure to the system log.
84 <term><option>quiet_success</option></term>
87 Don't log success to the system log.
92 <term><option>audit</option></term>
95 Log unknown users to the system log.
102 <emphasis>Condition</emphasis>s are three words: a field, a test,
103 and a value to test for.
106 Available fields are <emphasis>user</emphasis>,
107 <emphasis>uid</emphasis>, <emphasis>gid</emphasis>,
108 <emphasis>shell</emphasis>, <emphasis>home</emphasis>
109 and <emphasis>service</emphasis>:
114 <term><option>field < number</option></term>
116 <para>Field has a value numerically less than number.</para>
120 <term><option>field <= number</option></term>
123 Field has a value numerically less than or equal to number.
128 <term><option>field eq number</option></term>
131 Field has a value numerically equal to number.
136 <term><option>field >= number</option></term>
139 Field has a value numerically greater than or equal to number.
144 <term><option>field > number</option></term>
147 Field has a value numerically greater than number.
152 <term><option>field ne number</option></term>
155 Field has a value numerically different from number.
160 <term><option>field = string</option></term>
163 Field exactly matches the given string.
168 <term><option>field != string</option></term>
171 Field does not match the given string.
176 <term><option>field =~ glob</option></term>
178 <para>Field matches the given glob.</para>
182 <term><option>field !~ glob</option></term>
184 <para>Field does not match the given glob.</para>
188 <term><option>field in item:item:...</option></term>
190 <para>Field is contained in the list of items separated by colons.</para>
194 <term><option>field notin item:item:...</option></term>
196 <para>Field is not contained in the list of items separated by colons.</para>
200 <term><option>user ingroup group</option></term>
202 <para>User is in given group.</para>
206 <term><option>user notingroup group</option></term>
208 <para>User is not in given group.</para>
212 <term><option>user innetgr netgroup</option></term>
214 <para>(user,host) is in given netgroup.</para>
218 <term><option>user notinnetgr group</option></term>
220 <para>(user,host) is not in given netgroup.</para>
226 <refsect1 id="pam_succeed_if-types">
227 <title>MODULE TYPES PROVIDED</title>
229 All module types (<option>account</option>, <option>auth</option>,
230 <option>password</option> and <option>session</option>) are provided.
234 <refsect1 id='pam_succeed_if-return_values'>
235 <title>RETURN VALUES</title>
239 <term>PAM_SUCCESS</term>
242 The condition was true.
248 <term>PAM_AUTH_ERR</term>
251 The condition was false.
257 <term>PAM_SERVICE_ERR</term>
260 A service error occurred or the arguments can't be
269 <refsect1 id='pam_succeed_if-examples'>
270 <title>EXAMPLES</title>
272 To emulate the behaviour of <emphasis>pam_wheel</emphasis>, except
273 there is no fallback to group 0:
276 auth required pam_succeed_if.so quiet user ingroup wheel
280 Given that the type matches, only loads the othermodule rule if
281 the UID is over 500. Adjust the number after default to skip
285 type [default=1 success=ignore] pam_succeed_if.so quiet uid > 500
286 type required othermodule.so arguments...
290 <refsect1 id='pam_succeed_if-see_also'>
291 <title>SEE ALSO</title>
294 <refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum>
297 <refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum>
302 <refsect1 id='pam_succeed_if-author'>
303 <title>AUTHOR</title>
304 <para>Nalin Dahyabhai <nalin@redhat.com></para>