pam_sm_setcred.3.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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_setcred'>
  5. <refmeta>
  6. <refentrytitle>pam_sm_setcred</refentrytitle>
  7. <manvolnum>3</manvolnum>
  8. <refmiscinfo class='setdesc'>Linux-PAM Manual</refmiscinfo>
  9. </refmeta>
  10. <refnamediv id="pam_sm_setcred-name">
  11. <refname>pam_sm_setcred</refname>
  12. <refpurpose>PAM service function to alter credentials</refpurpose>
  13. </refnamediv>
  14. <!-- body begins here -->
  15. <refsynopsisdiv>
  16. <funcsynopsis id='pam_sm_setcred-synopsis'>
  17. <funcsynopsisinfo>#include &lt;security/pam_modules.h&gt;</funcsynopsisinfo>
  18. <funcprototype>
  19. <funcdef>int <function>pam_sm_setcred</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_setcred-description'>
  28. <title>DESCRIPTION</title>
  29. <para>
  30. The <function>pam_sm_setcred</function> function is the service
  31. module's implementation of the
  32. <citerefentry>
  33. <refentrytitle>pam_setcred</refentrytitle><manvolnum>3</manvolnum>
  34. </citerefentry> interface.
  35. </para>
  36. <para>
  37. This function performs the task of altering the credentials of the
  38. user with respect to the corresponding authorization
  39. scheme. Generally, an authentication module may have access to more
  40. information about a user than their authentication token. This
  41. function is used to make such information available to the
  42. application. It should only be called <emphasis>after</emphasis> the
  43. user has been authenticated but before a session has been established.
  44. </para>
  45. <para>
  46. Valid flags, which may be logically OR'd with
  47. <emphasis>PAM_SILENT</emphasis>, are:
  48. </para>
  49. <variablelist>
  50. <varlistentry>
  51. <term>PAM_SILENT</term>
  52. <listitem>
  53. <para>
  54. Do not emit any messages.
  55. </para>
  56. </listitem>
  57. </varlistentry>
  58. <varlistentry>
  59. <term>PAM_ESTABLISH_CRED</term>
  60. <listitem>
  61. <para>Initialize the credentials for the user.</para>
  62. </listitem>
  63. </varlistentry>
  64. <varlistentry>
  65. <term>PAM_DELETE_CRED</term>
  66. <listitem>
  67. <para>
  68. Delete the credentials associated with the authentication service.
  69. </para>
  70. </listitem>
  71. </varlistentry>
  72. <varlistentry>
  73. <term>PAM_REINITIALIZE_CRED</term>
  74. <listitem>
  75. <para>
  76. Reinitialize the user credentials.
  77. </para>
  78. </listitem>
  79. </varlistentry>
  80. <varlistentry>
  81. <term>PAM_REFRESH_CRED</term>
  82. <listitem>
  83. <para>
  84. Extend the lifetime of the user credentials.
  85. </para>
  86. </listitem>
  87. </varlistentry>
  88. </variablelist>
  89. <para>
  90. The way the <emphasis remap='B'>auth</emphasis> stack is
  91. navigated in order to evaluate the <function>pam_setcred</function>()
  92. function call, independent of the <function>pam_sm_setcred</function>()
  93. return codes, is exactly the same way that it was navigated when
  94. evaluating the <function>pam_authenticate</function>() library
  95. call. Typically, if a stack entry was ignored in evaluating
  96. <function>pam_authenticate</function>(), it will be ignored when
  97. libpam evaluates the <function>pam_setcred</function>() function
  98. call. Otherwise, the return codes from each module specific
  99. <function>pam_sm_setcred</function>() call are treated as
  100. <emphasis remap='B'>required</emphasis>.
  101. </para>
  102. </refsect1>
  103. <refsect1 id="pam_sm_setcred-return_values">
  104. <title>RETURN VALUES</title>
  105. <variablelist>
  106. <varlistentry>
  107. <term>PAM_CRED_UNAVAIL</term>
  108. <listitem>
  109. <para>
  110. This module cannot retrieve the user's credentials.
  111. </para>
  112. </listitem>
  113. </varlistentry>
  114. <varlistentry>
  115. <term>PAM_CRED_EXPIRED</term>
  116. <listitem>
  117. <para>
  118. The user's credentials have expired.
  119. </para>
  120. </listitem>
  121. </varlistentry>
  122. <varlistentry>
  123. <term>PAM_CRED_ERR</term>
  124. <listitem>
  125. <para>
  126. This module was unable to set the credentials of the user.
  127. </para>
  128. </listitem>
  129. </varlistentry>
  130. <varlistentry>
  131. <term>PAM_SUCCESS</term>
  132. <listitem>
  133. <para>
  134. The user credential was successfully set.
  135. </para>
  136. </listitem>
  137. </varlistentry>
  138. <varlistentry>
  139. <term>PAM_USER_UNKNOWN</term>
  140. <listitem>
  141. <para>
  142. The user is not known to this authentication module.
  143. </para>
  144. </listitem>
  145. </varlistentry>
  146. </variablelist>
  147. <para>
  148. These, non-<emphasis>PAM_SUCCESS</emphasis>, return values will
  149. typically lead to the credential stack <emphasis>failing</emphasis>.
  150. The first such error will dominate in the return value of
  151. <function>pam_setcred</function>().
  152. </para>
  153. </refsect1>
  154. <refsect1 id='pam_sm_setcred-see_also'>
  155. <title>SEE ALSO</title>
  156. <para>
  157. <citerefentry>
  158. <refentrytitle>pam</refentrytitle><manvolnum>3</manvolnum>
  159. </citerefentry>,
  160. <citerefentry>
  161. <refentrytitle>pam_authenticate</refentrytitle><manvolnum>3</manvolnum>
  162. </citerefentry>,
  163. <citerefentry>
  164. <refentrytitle>pam_setcred</refentrytitle><manvolnum>3</manvolnum>
  165. </citerefentry>,
  166. <citerefentry>
  167. <refentrytitle>pam_sm_authenticate</refentrytitle><manvolnum>3</manvolnum>
  168. </citerefentry>,
  169. <citerefentry>
  170. <refentrytitle>pam_strerror</refentrytitle><manvolnum>3</manvolnum>
  171. </citerefentry>,
  172. <citerefentry>
  173. <refentrytitle>PAM</refentrytitle><manvolnum>8</manvolnum>
  174. </citerefentry>
  175. </para>
  176. </refsect1>
  177. </refentry>