pam_getenvlist.3.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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_getenvlist'>
  5. <refmeta>
  6. <refentrytitle>pam_getenvlist</refentrytitle>
  7. <manvolnum>3</manvolnum>
  8. <refmiscinfo class='setdesc'>Linux-PAM Manual</refmiscinfo>
  9. </refmeta>
  10. <refnamediv id="pam_getenvlist-name">
  11. <refname>pam_getenvlist</refname>
  12. <refpurpose>getting the PAM environment</refpurpose>
  13. </refnamediv>
  14. <!-- body begins here -->
  15. <refsynopsisdiv>
  16. <funcsynopsis id='pam_getenvlist-synopsis'>
  17. <funcsynopsisinfo>#include &lt;security/pam_appl.h&gt;</funcsynopsisinfo>
  18. <funcprototype>
  19. <funcdef>char **<function>pam_getenvlist</function></funcdef>
  20. <paramdef>pam_handle_t *<parameter>pamh</parameter></paramdef>
  21. </funcprototype>
  22. </funcsynopsis>
  23. </refsynopsisdiv>
  24. <refsect1 id='pam_getenvlist-description'>
  25. <title>DESCRIPTION</title>
  26. <para>
  27. The <function>pam_getenvlist</function> function returns a complete
  28. copy of the PAM environment as associated with the handle
  29. <emphasis>pamh</emphasis>. The PAM environment variables
  30. represent the contents of the regular environment variables of the
  31. authenticated user when service is granted.
  32. </para>
  33. <para>
  34. The format of the memory is a malloc()'d array of char pointers,
  35. the last element of which is set to NULL. Each of the non-NULL
  36. entries in this array point to a NUL terminated and malloc()'d
  37. char string of the form: "<emphasis>name=value</emphasis>".
  38. </para>
  39. <para>
  40. It should be noted that this memory will never be free()'d by
  41. libpam. Once obtained by a call to
  42. <function>pam_getenvlist</function>, it is the responsibility of
  43. the calling application to free() this memory.
  44. </para>
  45. <para>
  46. It is by design, and not a coincidence, that the format and contents
  47. of the returned array matches that required for the third argument of
  48. the
  49. <citerefentry>
  50. <refentrytitle>execle</refentrytitle><manvolnum>3</manvolnum>
  51. </citerefentry> function call.
  52. </para>
  53. </refsect1>
  54. <refsect1 id="pam_getenvlist-return_values">
  55. <title>RETURN VALUES</title>
  56. <para>
  57. The <function>pam_getenvlist</function> function returns NULL
  58. on failure.
  59. </para>
  60. </refsect1>
  61. <refsect1 id='pam_getenvlist-see_also'>
  62. <title>SEE ALSO</title>
  63. <para>
  64. <citerefentry>
  65. <refentrytitle>pam_start</refentrytitle><manvolnum>3</manvolnum>
  66. </citerefentry>,
  67. <citerefentry>
  68. <refentrytitle>pam_getenv</refentrytitle><manvolnum>3</manvolnum>
  69. </citerefentry>,
  70. <citerefentry>
  71. <refentrytitle>pam_putenv</refentrytitle><manvolnum>3</manvolnum>
  72. </citerefentry>,
  73. <citerefentry>
  74. <refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum>
  75. </citerefentry>
  76. </para>
  77. </refsect1>
  78. </refentry>