]> granicus.if.org Git - linux-pam/blob - doc/man/pam_end.3.xml
Relevant BUGIDs:
[linux-pam] / doc / man / pam_end.3.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3                    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
4
5 <refentry id='pam_end'>
6
7   <refmeta>
8     <refentrytitle>pam_end</refentrytitle>
9     <manvolnum>3</manvolnum>
10     <refmiscinfo class='setdesc'>Linux-PAM Manual</refmiscinfo>
11   </refmeta>
12
13   <refnamediv id="pam_end-name">
14     <refname>pam_end</refname>
15     <refpurpose>termination of PAM transaction</refpurpose>
16   </refnamediv>
17
18 <!-- body begins here -->
19
20   <refsynopsisdiv>
21     <funcsynopsis id="pam_end-synopsis">
22       <funcsynopsisinfo>#include &lt;security/pam_appl.h&gt;</funcsynopsisinfo>
23       <funcprototype>
24         <funcdef>int <function>pam_end</function></funcdef>
25         <paramdef>pam_handle_t *<parameter>pamh</parameter></paramdef>
26         <paramdef>int <parameter>pam_status</parameter></paramdef>
27       </funcprototype>
28     </funcsynopsis>
29   </refsynopsisdiv>
30
31
32   <refsect1 id="pam_end-description">
33     <title>DESCRIPTION</title>
34     <para>
35       The <function>pam_end</function> function terminates the PAM
36       transaction and is the last function an application should call
37       in the PAM contenxt.  Upon return the handle <emphasis>pamh</emphasis>
38       is no longer valid and all memory associated with it will be
39       invalid.
40     </para>
41     <para>
42       The <emphasis>pam_status</emphasis> argument should be set to
43       the value returned to the application by the last PAM
44       library call.
45     </para>
46     <para>
47       The value taken by <emphasis>pam_status</emphasis> is used as
48       an argument to the module specific callback function,
49       <function>cleanup()</function>
50       (See <citerefentry>
51          <refentrytitle>pam_set_data</refentrytitle><manvolnum>3</manvolnum>
52       </citerefentry> and
53       <citerefentry>
54         <refentrytitle>pam_get_data</refentrytitle><manvolnum>3</manvolnum>
55       </citerefentry>). In this way the module can be given notification
56       of the pass/fail nature of the tear-down process, and perform any
57       last minute tasks that are appropriate to the module before it is
58       unlinked. This argument can be logically OR'd with
59       <emphasis>PAM_DATA_SILENT</emphasis> to indicate to indicate that
60       the module should not treat the call too seriously. It is generally
61       used to indicate that the current closing of the library is in a
62       <citerefentry>
63         <refentrytitle>fork</refentrytitle><manvolnum>2</manvolnum>
64       </citerefentry>ed
65       process, and that the parent will take care of cleaning up things
66       that exist outside of the current process space (files etc.).
67     </para>
68
69     <para>
70       This function <emphasis>free</emphasis>'s all memory for items
71       associated with the
72       <citerefentry>
73         <refentrytitle>pam_set_item</refentrytitle><manvolnum>3</manvolnum>
74       </citerefentry> and
75       <citerefentry>
76         <refentrytitle>pam_get_item</refentrytitle><manvolnum>3</manvolnum>
77       </citerefentry> functions. Pointers associated with such objects
78       are not valid anymore after <function>pam_end</function> was called.
79     </para>
80
81   </refsect1>
82   <refsect1 id="pam_end-return_values">
83     <title>RETURN VALUES</title>
84     <variablelist>
85       <varlistentry>
86         <term>PAM_SUCCESS</term>
87         <listitem>
88            <para>
89              Transaction was successful terminated.
90           </para>
91         </listitem>
92       </varlistentry>
93       <varlistentry>
94         <term>PAM_SYSTEM_ERR</term>
95         <listitem>
96            <para>
97               System error, for example a NULL pointer was submitted
98               as PAM handle or the function was called by a module.
99           </para>
100         </listitem>
101       </varlistentry>
102     </variablelist>
103   </refsect1>
104
105   <refsect1 id="pam_end-see_also">
106     <title>SEE ALSO</title>
107     <para>
108       <citerefentry>
109         <refentrytitle>pam_get_data</refentrytitle><manvolnum>3</manvolnum>
110       </citerefentry>,
111       <citerefentry>
112         <refentrytitle>pam_set_data</refentrytitle><manvolnum>3</manvolnum>
113       </citerefentry>,
114       <citerefentry>
115         <refentrytitle>pam_start</refentrytitle><manvolnum>3</manvolnum>
116       </citerefentry>,
117       <citerefentry>
118         <refentrytitle>pam_strerror</refentrytitle><manvolnum>3</manvolnum>
119       </citerefentry>
120     </para>
121   </refsect1>
122 </refentry>