pam_sm_chauthtok.3.xml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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_sm_chauthtok'>
  5. <refmeta>
  6. <refentrytitle>pam_sm_chauthtok</refentrytitle>
  7. <manvolnum>3</manvolnum>
  8. <refmiscinfo class='setdesc'>Linux-PAM Manual</refmiscinfo>
  9. </refmeta>
  10. <refnamediv id="pam_sm_chauthtok-name">
  11. <refname>pam_sm_chauthtok</refname>
  12. <refpurpose>PAM service function for authentication token management</refpurpose>
  13. </refnamediv>
  14. <!-- body begins here -->
  15. <refsynopsisdiv>
  16. <funcsynopsis id='pam_sm_chauthtok-synopsis'>
  17. <funcsynopsisinfo>#include &lt;security/pam_modules.h&gt;</funcsynopsisinfo>
  18. <funcprototype>
  19. <funcdef>int <function>pam_sm_chauthtok</function></funcdef>
  20. <paramdef>pam_handle_t *<parameter>pamh</parameter></paramdef>
  21. <paramdef>int <parameter>flags</parameter></paramdef>
  22. <paramdef>int <parameter>argc</parameter></paramdef>
  23. <paramdef>const char **<parameter>argv</parameter></paramdef>
  24. </funcprototype>
  25. </funcsynopsis>
  26. </refsynopsisdiv>
  27. <refsect1 id='pam_sm_chauthtok-description'>
  28. <title>DESCRIPTION</title>
  29. <para>
  30. The <function>pam_sm_chauthtok</function> function is the service
  31. module's implementation of the
  32. <citerefentry>
  33. <refentrytitle>pam_chauthtok</refentrytitle><manvolnum>3</manvolnum>
  34. </citerefentry> interface.
  35. </para>
  36. <para>
  37. This function is used to (re-)set the authentication token of the user.
  38. </para>
  39. <para>
  40. Valid flags, which may be logically OR'd with
  41. <emphasis>PAM_SILENT</emphasis>, are:
  42. </para>
  43. <variablelist>
  44. <varlistentry>
  45. <term>PAM_SILENT</term>
  46. <listitem>
  47. <para>
  48. Do not emit any messages.
  49. </para>
  50. </listitem>
  51. </varlistentry>
  52. <varlistentry>
  53. <term>PAM_CHANGE_EXPIRED_AUTHTOK</term>
  54. <listitem>
  55. <para>
  56. This argument indicates to the module that the user's
  57. authentication token (password) should only be changed if
  58. it has expired. This flag is optional and
  59. <emphasis>must</emphasis> be combined with one of the
  60. following two flags. Note, however, the following two options
  61. are <emphasis>mutually exclusive</emphasis>.
  62. </para>
  63. </listitem>
  64. </varlistentry>
  65. <varlistentry>
  66. <term>PAM_PRELIM_CHECK</term>
  67. <listitem>
  68. <para>
  69. This indicates that the modules are being probed as to
  70. their ready status for altering the user's authentication
  71. token. If the module requires access to another system over
  72. some network it should attempt to verify it can connect to
  73. this system on receiving this flag. If a module cannot establish
  74. it is ready to update the user's authentication token it should
  75. return <emphasis remap='B'>PAM_TRY_AGAIN</emphasis>, this
  76. information will be passed back to the application.
  77. </para>
  78. <para>
  79. If the control value <emphasis>sufficient</emphasis> is used in
  80. the password stack, the <emphasis>PAM_PRELIM_CHECK</emphasis> section
  81. of the modules following that control value is not always executed.
  82. </para>
  83. </listitem>
  84. </varlistentry>
  85. <varlistentry>
  86. <term>PAM_UPDATE_AUTHTOK</term>
  87. <listitem>
  88. <para>
  89. This informs the module that this is the call it should change
  90. the authorization tokens. If the flag is logically OR'd with
  91. <emphasis remap='B'>PAM_CHANGE_EXPIRED_AUTHTOK</emphasis>, the
  92. token is only changed if it has actually expired.
  93. </para>
  94. </listitem>
  95. </varlistentry>
  96. </variablelist>
  97. <para>
  98. The PAM library calls this function twice in succession. The first
  99. time with <emphasis remap='B'>PAM_PRELIM_CHECK</emphasis> and then,
  100. if the module does not return
  101. <emphasis remap='B'>PAM_TRY_AGAIN</emphasis>, subsequently with
  102. <emphasis remap='B'>PAM_UPDATE_AUTHTOK</emphasis>. It is only on
  103. the second call that the authorization token is (possibly) changed.
  104. </para>
  105. </refsect1>
  106. <refsect1 id="pam_sm_chauthtok-return_values">
  107. <title>RETURN VALUES</title>
  108. <variablelist>
  109. <varlistentry>
  110. <term>PAM_AUTHTOK_ERR</term>
  111. <listitem>
  112. <para>
  113. The module was unable to obtain the new authentication token.
  114. </para>
  115. </listitem>
  116. </varlistentry>
  117. <varlistentry>
  118. <term>PAM_AUTHTOK_RECOVERY_ERR</term>
  119. <listitem>
  120. <para>
  121. The module was unable to obtain the old authentication token.
  122. </para>
  123. </listitem>
  124. </varlistentry>
  125. <varlistentry>
  126. <term>PAM_AUTHTOK_LOCK_BUSY</term>
  127. <listitem>
  128. <para>
  129. Cannot change the authentication token since it is currently
  130. locked.
  131. </para>
  132. </listitem>
  133. </varlistentry>
  134. <varlistentry>
  135. <term>PAM_AUTHTOK_DISABLE_AGING</term>
  136. <listitem>
  137. <para>
  138. Authentication token aging has been disabled.
  139. </para>
  140. </listitem>
  141. </varlistentry>
  142. <varlistentry>
  143. <term>PAM_PERM_DENIED</term>
  144. <listitem>
  145. <para>
  146. Permission denied.
  147. </para>
  148. </listitem>
  149. </varlistentry>
  150. <varlistentry>
  151. <term>PAM_TRY_AGAIN</term>
  152. <listitem>
  153. <para>
  154. Preliminary check was unsuccessful. Signals an immediate
  155. return to the application is desired.
  156. </para>
  157. </listitem>
  158. </varlistentry>
  159. <varlistentry>
  160. <term>PAM_SUCCESS</term>
  161. <listitem>
  162. <para>
  163. The authentication token was successfully updated.
  164. </para>
  165. </listitem>
  166. </varlistentry>
  167. <varlistentry>
  168. <term>PAM_USER_UNKNOWN</term>
  169. <listitem>
  170. <para>
  171. User unknown to password service.
  172. </para>
  173. </listitem>
  174. </varlistentry>
  175. </variablelist>
  176. </refsect1>
  177. <refsect1 id='pam_sm_chauthtok-see_also'>
  178. <title>SEE ALSO</title>
  179. <para>
  180. <citerefentry>
  181. <refentrytitle>pam</refentrytitle><manvolnum>3</manvolnum>
  182. </citerefentry>,
  183. <citerefentry>
  184. <refentrytitle>pam_chauthtok</refentrytitle><manvolnum>3</manvolnum>
  185. </citerefentry>,
  186. <citerefentry>
  187. <refentrytitle>pam_sm_chauthtok</refentrytitle><manvolnum>3</manvolnum>
  188. </citerefentry>,
  189. <citerefentry>
  190. <refentrytitle>pam_strerror</refentrytitle><manvolnum>3</manvolnum>
  191. </citerefentry>,
  192. <citerefentry>
  193. <refentrytitle>PAM</refentrytitle><manvolnum>8</manvolnum>
  194. </citerefentry>
  195. </para>
  196. </refsect1>
  197. </refentry>