pam_start.3.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. <refentry id='pam_start'>
  5. <refmeta>
  6. <refentrytitle>pam_start</refentrytitle>
  7. <manvolnum>3</manvolnum>
  8. <refmiscinfo class='setdesc'>Linux-PAM Manual</refmiscinfo>
  9. </refmeta>
  10. <refnamediv id="pam_start-name">
  11. <refname>pam_start</refname>
  12. <refname>pam_start_confdir</refname>
  13. <refpurpose>initialization of PAM transaction</refpurpose>
  14. </refnamediv>
  15. <!-- body begins here -->
  16. <refsynopsisdiv>
  17. <funcsynopsis id="pam_start-synopsis">
  18. <funcsynopsisinfo>#include &lt;security/pam_appl.h&gt;</funcsynopsisinfo>
  19. <funcprototype>
  20. <funcdef>int <function>pam_start</function></funcdef>
  21. <paramdef>const char *<parameter>service_name</parameter></paramdef>
  22. <paramdef>const char *<parameter>user</parameter></paramdef>
  23. <paramdef>const struct pam_conv *<parameter>pam_conversation</parameter></paramdef>
  24. <paramdef>pam_handle_t **<parameter>pamh</parameter></paramdef>
  25. </funcprototype>
  26. <funcprototype>
  27. <funcdef>int <function>pam_start_confdir</function></funcdef>
  28. <paramdef>const char *<parameter>service_name</parameter></paramdef>
  29. <paramdef>const char *<parameter>user</parameter></paramdef>
  30. <paramdef>const struct pam_conv *<parameter>pam_conversation</parameter></paramdef>
  31. <paramdef>const char *<parameter>confdir</parameter></paramdef>
  32. <paramdef>pam_handle_t **<parameter>pamh</parameter></paramdef>
  33. </funcprototype>
  34. </funcsynopsis>
  35. </refsynopsisdiv>
  36. <refsect1 id="pam_start-description">
  37. <title>DESCRIPTION</title>
  38. <para>
  39. The <function>pam_start</function> function creates the PAM context
  40. and initiates the PAM transaction. It is the first of the PAM
  41. functions that needs to be called by an application. The transaction
  42. state is contained entirely within the structure identified by this
  43. handle, so it is possible to have multiple transactions in parallel.
  44. But it is not possible to use the same handle for different
  45. transactions, a new one is needed for every new context.
  46. </para>
  47. <para>
  48. The <emphasis>service_name</emphasis> argument specifies the name
  49. of the service to apply and will be stored as PAM_SERVICE item in
  50. the new context. The policy for the service will be read from the
  51. file <filename>/etc/pam.d/service_name</filename> or, if that file
  52. does not exist, from <filename>/etc/pam.conf</filename>.
  53. </para>
  54. <para>
  55. The <emphasis>user</emphasis> argument can specify the name
  56. of the target user and will be stored as PAM_USER item. If
  57. the argument is NULL, the module has to ask for this item if
  58. necessary.
  59. </para>
  60. <para>
  61. The <emphasis>pam_conversation</emphasis> argument points to
  62. a <emphasis>struct pam_conv</emphasis> describing the
  63. conversation function to use. An application must provide this
  64. for direct communication between a loaded module and the
  65. application.
  66. </para>
  67. <para>
  68. Following a successful return (PAM_SUCCESS) the contents of
  69. <emphasis>pamh</emphasis> is a handle that contains the PAM
  70. context for successive calls to the PAM functions. In an error
  71. case is the content of <emphasis>pamh</emphasis> undefined.
  72. </para>
  73. <para>
  74. The <emphasis>pam_handle_t</emphasis> is a blind structure and
  75. the application should not attempt to probe it directly for
  76. information. Instead the PAM library provides the functions
  77. <citerefentry>
  78. <refentrytitle>pam_set_item</refentrytitle><manvolnum>3</manvolnum>
  79. </citerefentry> and
  80. <citerefentry>
  81. <refentrytitle>pam_get_item</refentrytitle><manvolnum>3</manvolnum>
  82. </citerefentry>.
  83. The PAM handle cannot be used for multiple authentications at the
  84. same time as long as <function>pam_end</function> was not called on
  85. it before.
  86. </para>
  87. <para>
  88. The <function>pam_start_confdir</function> function behaves
  89. like the <function>pam_start</function> function but it also
  90. allows setting <emphasis>confdir</emphasis> argument with
  91. a path to a directory to override the default
  92. (<filename>/etc/pam.d</filename>) path for service policy
  93. files. If the <emphasis>confdir</emphasis> is NULL, the function
  94. works exactly the same as <function>pam_start</function>.
  95. </para>
  96. </refsect1>
  97. <refsect1 id="pam_start-return_values">
  98. <title>RETURN VALUES</title>
  99. <variablelist>
  100. <varlistentry>
  101. <term>PAM_ABORT</term>
  102. <listitem>
  103. <para>
  104. General failure.
  105. </para>
  106. </listitem>
  107. </varlistentry>
  108. <varlistentry>
  109. <term>PAM_BUF_ERR</term>
  110. <listitem>
  111. <para>
  112. Memory buffer error.
  113. </para>
  114. </listitem>
  115. </varlistentry>
  116. <varlistentry>
  117. <term>PAM_SUCCESS</term>
  118. <listitem>
  119. <para>
  120. Transaction was successfully started.
  121. </para>
  122. </listitem>
  123. </varlistentry>
  124. <varlistentry>
  125. <term>PAM_SYSTEM_ERR</term>
  126. <listitem>
  127. <para>
  128. System error, for example a NULL pointer was submitted
  129. instead of a pointer to data.
  130. </para>
  131. </listitem>
  132. </varlistentry>
  133. </variablelist>
  134. </refsect1>
  135. <refsect1 id="pam_start-see_also">
  136. <title>SEE ALSO</title>
  137. <para>
  138. <citerefentry>
  139. <refentrytitle>pam_get_data</refentrytitle><manvolnum>3</manvolnum>
  140. </citerefentry>,
  141. <citerefentry>
  142. <refentrytitle>pam_set_data</refentrytitle><manvolnum>3</manvolnum>
  143. </citerefentry>,
  144. <citerefentry>
  145. <refentrytitle>pam_end</refentrytitle><manvolnum>3</manvolnum>
  146. </citerefentry>,
  147. <citerefentry>
  148. <refentrytitle>pam_strerror</refentrytitle><manvolnum>3</manvolnum>
  149. </citerefentry>
  150. </para>
  151. </refsect1>
  152. </refentry>