pam_putenv.3.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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_putenv'>
  5. <refmeta>
  6. <refentrytitle>pam_putenv</refentrytitle>
  7. <manvolnum>3</manvolnum>
  8. <refmiscinfo class='setdesc'>Linux-PAM Manual</refmiscinfo>
  9. </refmeta>
  10. <refnamediv id="pam_putenv-name">
  11. <refname>pam_putenv</refname>
  12. <refpurpose>set or change PAM environment variable</refpurpose>
  13. </refnamediv>
  14. <!-- body begins here -->
  15. <refsynopsisdiv>
  16. <funcsynopsis id='pam_putenv-synopsis'>
  17. <funcsynopsisinfo>#include &lt;security/pam_appl.h&gt;</funcsynopsisinfo>
  18. <funcprototype>
  19. <funcdef>int <function>pam_putenv</function></funcdef>
  20. <paramdef>pam_handle_t *<parameter>pamh</parameter></paramdef>
  21. <paramdef>const char *<parameter>name_value</parameter></paramdef>
  22. </funcprototype>
  23. </funcsynopsis>
  24. </refsynopsisdiv>
  25. <refsect1 id='pam_putenv-description'>
  26. <title>DESCRIPTION</title>
  27. <para>
  28. The <function>pam_putenv</function> function is used to
  29. add or change the value of PAM environment variables as
  30. associated with the <emphasis>pamh</emphasis> handle.
  31. </para>
  32. <para>
  33. The <emphasis>pamh</emphasis> argument is an authentication
  34. handle obtained by a prior call to pam_start().
  35. The <emphasis>name_value</emphasis> argument is a single NUL
  36. terminated string of one of the following forms:
  37. </para>
  38. <variablelist>
  39. <varlistentry>
  40. <term>NAME=value of variable</term>
  41. <listitem>
  42. <para>
  43. In this case the environment variable of the given NAME
  44. is set to the indicated value:
  45. <emphasis>value of variable</emphasis>. If this variable
  46. is already known, it is overwritten. Otherwise it is added
  47. to the PAM environment.
  48. </para>
  49. </listitem>
  50. </varlistentry>
  51. <varlistentry>
  52. <term>NAME=</term>
  53. <listitem>
  54. <para>
  55. This function sets the variable to an empty value. It is
  56. listed separately to indicate that this is the correct way
  57. to achieve such a setting.
  58. </para>
  59. </listitem>
  60. </varlistentry>
  61. <varlistentry>
  62. <term>NAME</term>
  63. <listitem>
  64. <para>
  65. Without an '=' the <function>pam_putenv</function>() function
  66. will delete the
  67. corresponding variable from the PAM environment.
  68. </para>
  69. </listitem>
  70. </varlistentry>
  71. </variablelist>
  72. <para>
  73. <function>pam_putenv</function>() operates on a copy of
  74. <emphasis>name_value</emphasis>, which means in contrast to
  75. <citerefentry>
  76. <refentrytitle>putenv</refentrytitle><manvolnum>3</manvolnum>
  77. </citerefentry>, the application is responsible for freeing the data.
  78. </para>
  79. </refsect1>
  80. <refsect1 id="pam_putenv-return_values">
  81. <title>RETURN VALUES</title>
  82. <variablelist>
  83. <varlistentry>
  84. <term>PAM_PERM_DENIED</term>
  85. <listitem>
  86. <para>
  87. Argument <emphasis>name_value</emphasis> given is a NULL pointer.
  88. </para>
  89. </listitem>
  90. </varlistentry>
  91. <varlistentry>
  92. <term>PAM_BAD_ITEM</term>
  93. <listitem>
  94. <para>
  95. Variable requested (for deletion) is not currently set.
  96. </para>
  97. </listitem>
  98. </varlistentry>
  99. <varlistentry>
  100. <term>PAM_ABORT</term>
  101. <listitem>
  102. <para>
  103. The <emphasis>pamh</emphasis> handle is corrupt.
  104. </para>
  105. </listitem>
  106. </varlistentry>
  107. <varlistentry>
  108. <term>PAM_BUF_ERR</term>
  109. <listitem>
  110. <para>
  111. Memory buffer error.
  112. </para>
  113. </listitem>
  114. </varlistentry>
  115. <varlistentry>
  116. <term>PAM_SUCCESS</term>
  117. <listitem>
  118. <para>
  119. The environment variable was successfully updated.
  120. </para>
  121. </listitem>
  122. </varlistentry>
  123. </variablelist>
  124. </refsect1>
  125. <refsect1 id='pam_putenv-see_also'>
  126. <title>SEE ALSO</title>
  127. <para>
  128. <citerefentry>
  129. <refentrytitle>pam_start</refentrytitle><manvolnum>3</manvolnum>
  130. </citerefentry>,
  131. <citerefentry>
  132. <refentrytitle>pam_getenv</refentrytitle><manvolnum>3</manvolnum>
  133. </citerefentry>,
  134. <citerefentry>
  135. <refentrytitle>pam_getenvlist</refentrytitle><manvolnum>3</manvolnum>
  136. </citerefentry>,
  137. <citerefentry>
  138. <refentrytitle>pam_strerror</refentrytitle><manvolnum>3</manvolnum>
  139. </citerefentry>,
  140. <citerefentry>
  141. <refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum>
  142. </citerefentry>
  143. </para>
  144. </refsect1>
  145. </refentry>