summaryrefslogtreecommitdiff
path: root/modules/pam_filter/pam_filter.8.xml
blob: 7309c352a3ee8fecff924633e7ff920241c8d09d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<?xml version="1.0" encoding='UTF-8'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
	"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">

<refentry id="pam_filter">

  <refmeta>
    <refentrytitle>pam_filter</refentrytitle>
    <manvolnum>8</manvolnum>
    <refmiscinfo class="sectdesc">Linux-PAM Manual</refmiscinfo>
  </refmeta>

  <refnamediv id="pam_filter-name">
    <refname>pam_filter</refname>
    <refpurpose>PAM filter module</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis id="pam_filter-cmdsynopsis">
      <command>pam_filter.so</command>
      <arg choice="opt">
	debug
      </arg>
      <arg choice="opt">
        new_term
      </arg>
      <arg choice="opt">
        non_term
      </arg>
      <arg choice="plain">
        run1|run2
      </arg>
      <arg choice="plain">
        <replaceable>filter</replaceable>
      </arg>
      <arg choice="opt">
        <replaceable>...</replaceable>
      </arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1 id="pam_filter-description">

    <title>DESCRIPTION</title>

    <para>
      This module is intended to be a platform for providing access to all
      of the input/output that passes between the user and the application.
      It is only suitable for tty-based and (stdin/stdout) applications.
    </para>
    <para>
      To function this module requires <emphasis>filters</emphasis> to be
      installed on the system.
      The single filter provided with the module simply transposes upper and
      lower case letters in the input and output streams. (This can be very
      annoying and is not kind to termcap based editors).
    </para>
    <para>
      Each component of the module has the potential to invoke the
      desired filter. The filter is always
      <citerefentry>
        <refentrytitle>execv</refentrytitle><manvolnum>2</manvolnum>
      </citerefentry> with the privilege of the calling application
      and <emphasis>not</emphasis> that of the user. For this reason it
      cannot usually be killed by the user without closing their session.
    </para>
  </refsect1>

  <refsect1 id="pam_filter-options">

    <title>OPTIONS</title>
    <para>
      <variablelist>

        <varlistentry>
          <term>
            <option>debug</option>
          </term>
          <listitem>
            <para>
	      Print debug information.
            </para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>
            <option>new_term</option>
          </term>
          <listitem>
            <para>
              The default action of the filter is to set the
              <emphasis>PAM_TTY</emphasis> item to indicate the
              terminal that the user is using to connect to the
              application. This argument indicates that the filter
              should set <emphasis>PAM_TTY</emphasis> to the filtered
              pseudo-terminal.
            </para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>
            <option>non_term</option>
          </term>
          <listitem>
            <para>
              don't try to set the <emphasis>PAM_TTY</emphasis> item.
            </para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>
            <option>runX</option>
          </term>
          <listitem>
            <para>
              In order that the module can invoke a filter it should
              know when to invoke it. This argument is required to tell
              the filter when to do this.
            </para>
            <para>
              Permitted values for <emphasis>X</emphasis> are
              <emphasis>1</emphasis> and <emphasis>2</emphasis>. These
              indicate the precise time that the filter is to be run.
              To understand this concept it will be useful to have read
              the <citerefentry>
                <refentrytitle>pam</refentrytitle><manvolnum>3</manvolnum>
              </citerefentry> manual page.
              Basically, for each management group there are up to two ways
              of calling the module's functions.
              In the case of the <emphasis>authentication</emphasis> and
              <emphasis>session</emphasis> components there are actually
              two separate functions. For the case of authentication, these
              functions are
              <citerefentry>
                <refentrytitle>pam_authenticate</refentrytitle><manvolnum>3</manvolnum>
              </citerefentry> and
              <citerefentry>
                <refentrytitle>pam_setcred</refentrytitle><manvolnum>3</manvolnum>
              </citerefentry>, here <option>run1</option> means run the
              filter from the <function>pam_authenticate</function> function
              and <option>run2</option> means run the filter from
              <function>pam_setcred</function>. In the case of the
              session modules, <emphasis>run1</emphasis> implies
              that the filter is invoked at the
              <citerefentry>
                <refentrytitle>pam_open_session</refentrytitle><manvolnum>3</manvolnum>
              </citerefentry> stage, and <emphasis>run2</emphasis> for
              <citerefentry>
                <refentrytitle>pam_close_session</refentrytitle><manvolnum>3</manvolnum>
              </citerefentry>.
            </para>
            <para>
              For the case of the account component. Either
              <emphasis>run1</emphasis> or <emphasis>run2</emphasis>
              may be used.
            </para>
            <para>
              For the case of the password component, <emphasis>run1</emphasis>
              is used to indicate that the filter is run on the first
              occasion of
              <citerefentry>
                <refentrytitle>pam_chauthtok</refentrytitle><manvolnum>3</manvolnum>
              </citerefentry> (the <emphasis>PAM_PRELIM_CHECK</emphasis>
              phase) and <emphasis>run2</emphasis> is used to indicate
              that the filter is run on the second occasion (the
              <emphasis>PAM_UPDATE_AUTHTOK</emphasis> phase).

            </para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>
            <option>filter</option>
          </term>
          <listitem>
            <para>
              The full pathname of the filter to be run and any command line
              arguments that the filter might expect.
            </para>
          </listitem>
        </varlistentry>
      </variablelist>

    </para>
  </refsect1>

  <refsect1 id="pam_filter-types">
    <title>MODULE TYPES PROVIDED</title>
    <para>
      All module types (<option>auth</option>, <option>account</option>,
      <option>password</option> and <option>session</option>) are provided.
    </para>
  </refsect1>

  <refsect1 id='pam_filter-return_values'>
    <title>RETURN VALUES</title>
    <para>
      <variablelist>

        <varlistentry>
          <term>PAM_SUCCESS</term>
          <listitem>
            <para>
              The new filter was set successfully.
            </para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>PAM_ABORT</term>
          <listitem>
            <para>
	      Critical error, immediate abort.
            </para>
          </listitem>
        </varlistentry>

      </variablelist>
    </para>
  </refsect1>

  <refsect1 id='pam_filter-examples'>
    <title>EXAMPLES</title>
    <para>
      Add the following line to <filename>/etc/pam.d/login</filename> to
      see how to configure login to transpose upper and lower case letters
      once the user has logged in:

      <programlisting>
        session required pam_filter.so run1 /lib/security/pam_filter/upperLOWER
      </programlisting>
    </para>
  </refsect1>

  <refsect1 id='pam_filter-see_also'>
    <title>SEE ALSO</title>
    <para>
      <citerefentry>
	<refentrytitle>pam.conf</refentrytitle><manvolnum>5</manvolnum>
      </citerefentry>,
      <citerefentry>
	<refentrytitle>pam.d</refentrytitle><manvolnum>5</manvolnum>
      </citerefentry>,
      <citerefentry>
	<refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>
    </para>
  </refsect1>

  <refsect1 id='pam_filter-author'>
    <title>AUTHOR</title>
      <para>
        pam_filter was written by Andrew G. Morgan &lt;morgan@kernel.org&gt;.
      </para>
  </refsect1>

</refentry>