pam_setcred.3.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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_setcred">
  5. <refmeta>
  6. <refentrytitle>pam_setcred</refentrytitle>
  7. <manvolnum>3</manvolnum>
  8. <refmiscinfo class='setdesc'>Linux-PAM Manual</refmiscinfo>
  9. </refmeta>
  10. <refnamediv id="pam_setcred-name">
  11. <refname>pam_setcred</refname>
  12. <refpurpose>
  13. establish / delete user credentials
  14. </refpurpose>
  15. </refnamediv>
  16. <!-- body begins here -->
  17. <refsynopsisdiv>
  18. <funcsynopsis id='pam_setcred-synopsis'>
  19. <funcsynopsisinfo>#include &lt;security/pam_appl.h&gt;</funcsynopsisinfo>
  20. <funcprototype>
  21. <funcdef>int <function>pam_setcred</function></funcdef>
  22. <paramdef>pam_handle_t *<parameter>pamh</parameter></paramdef>
  23. <paramdef>int <parameter>flags</parameter></paramdef>
  24. </funcprototype>
  25. </funcsynopsis>
  26. </refsynopsisdiv>
  27. <refsect1 id='pam_setcred-description'>
  28. <title>DESCRIPTION</title>
  29. <para>
  30. The <function>pam_setcred</function> function is used to establish,
  31. maintain and delete the credentials of a user. It should be called
  32. to set the credentials after a user has been authenticated and before
  33. a session is opened for the user (with
  34. <citerefentry>
  35. <refentrytitle>pam_open_session</refentrytitle><manvolnum>3</manvolnum>
  36. </citerefentry>). The credentials should be deleted after the session
  37. has been closed (with
  38. <citerefentry>
  39. <refentrytitle>pam_close_session</refentrytitle><manvolnum>3</manvolnum>
  40. </citerefentry>).
  41. </para>
  42. <para>
  43. A credential is something that the user possesses. It is some
  44. property, such as a <emphasis>Kerberos</emphasis> ticket, or a
  45. supplementary group membership that make up the uniqueness of a
  46. given user. On a Linux system the user's <emphasis>UID</emphasis>
  47. and <emphasis>GID</emphasis>'s are credentials too. However, it
  48. has been decided that these properties (along with the default
  49. supplementary groups of which the user is a member) are credentials
  50. that should be set directly by the application and not by PAM.
  51. Such credentials should be established, by the application, prior
  52. to a call to this function. For example,
  53. <citerefentry>
  54. <refentrytitle>initgroups</refentrytitle><manvolnum>2</manvolnum>
  55. </citerefentry> (or equivalent) should have been performed.
  56. </para>
  57. <para>
  58. Valid <emphasis>flags</emphasis>, any one of which, may be
  59. logically OR'd with <option>PAM_SILENT</option>, are:
  60. </para>
  61. <variablelist>
  62. <varlistentry>
  63. <term>PAM_ESTABLISH_CRED</term>
  64. <listitem>
  65. <para>Initialize the credentials for the user.</para>
  66. </listitem>
  67. </varlistentry>
  68. <varlistentry>
  69. <term>PAM_DELETE_CRED</term>
  70. <listitem>
  71. <para>Delete the user's credentials.</para>
  72. </listitem>
  73. </varlistentry>
  74. <varlistentry>
  75. <term>PAM_REINITIALIZE_CRED</term>
  76. <listitem>
  77. <para>Fully reinitialize the user's credentials.</para>
  78. </listitem>
  79. </varlistentry>
  80. <varlistentry>
  81. <term>PAM_REFRESH_CRED</term>
  82. <listitem>
  83. <para>Extend the lifetime of the existing credentials.</para>
  84. </listitem>
  85. </varlistentry>
  86. </variablelist>
  87. </refsect1>
  88. <refsect1 id='pam_setcred-return_values'>
  89. <title>RETURN VALUES</title>
  90. <variablelist>
  91. <varlistentry>
  92. <term>PAM_BUF_ERR</term>
  93. <listitem>
  94. <para>
  95. Memory buffer error.
  96. </para>
  97. </listitem>
  98. </varlistentry>
  99. <varlistentry>
  100. <term>PAM_CRED_ERR</term>
  101. <listitem>
  102. <para>
  103. Failed to set user credentials.
  104. </para>
  105. </listitem>
  106. </varlistentry>
  107. <varlistentry>
  108. <term>PAM_CRED_EXPIRED</term>
  109. <listitem>
  110. <para>
  111. User credentials are expired.
  112. </para>
  113. </listitem>
  114. </varlistentry>
  115. <varlistentry>
  116. <term>PAM_CRED_UNAVAIL</term>
  117. <listitem>
  118. <para>
  119. Failed to retrieve user credentials.
  120. </para>
  121. </listitem>
  122. </varlistentry>
  123. <varlistentry>
  124. <term>PAM_SUCCESS</term>
  125. <listitem>
  126. <para>
  127. Data was successful stored.
  128. </para>
  129. </listitem>
  130. </varlistentry>
  131. <varlistentry>
  132. <term>PAM_SYSTEM_ERR</term>
  133. <listitem>
  134. <para>
  135. A NULL pointer was submitted as PAM handle, the
  136. function was called by a module or another system
  137. error occurred.
  138. </para>
  139. </listitem>
  140. </varlistentry>
  141. <varlistentry>
  142. <term>PAM_USER_UNKNOWN</term>
  143. <listitem>
  144. <para>
  145. User is not known to an authentication module.
  146. </para>
  147. </listitem>
  148. </varlistentry>
  149. </variablelist>
  150. </refsect1>
  151. <refsect1 id="pam_set_data-see_also">
  152. <title>SEE ALSO</title>
  153. <para>
  154. <citerefentry>
  155. <refentrytitle>pam_authenticate</refentrytitle><manvolnum>3</manvolnum>
  156. </citerefentry>,
  157. <citerefentry>
  158. <refentrytitle>pam_open_session</refentrytitle><manvolnum>3</manvolnum>
  159. </citerefentry>,
  160. <citerefentry>
  161. <refentrytitle>pam_close_session</refentrytitle><manvolnum>3</manvolnum>
  162. </citerefentry>,
  163. <citerefentry>
  164. <refentrytitle>pam_strerror</refentrytitle><manvolnum>3</manvolnum>
  165. </citerefentry>
  166. </para>
  167. </refsect1>
  168. </refentry>