misc_conv.3.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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="misc_conv">
  5. <refmeta>
  6. <refentrytitle>misc_conv</refentrytitle>
  7. <manvolnum>3</manvolnum>
  8. <refmiscinfo class='setdesc'>Linux-PAM Manual</refmiscinfo>
  9. </refmeta>
  10. <refnamediv id="misc_conv-name">
  11. <refname>misc_conv</refname>
  12. <refpurpose>text based conversation function</refpurpose>
  13. </refnamediv>
  14. <!-- body begins here -->
  15. <refsynopsisdiv>
  16. <funcsynopsis id="misc_conv-synopsis">
  17. <funcsynopsisinfo>#include &lt;security/pam_misc.h&gt;</funcsynopsisinfo>
  18. <funcprototype>
  19. <funcdef>int <function>misc_conv</function></funcdef>
  20. <paramdef>int <parameter>num_msg</parameter></paramdef>
  21. <paramdef>const struct pam_message **<parameter>msgm</parameter></paramdef>
  22. <paramdef>struct pam_response **<parameter>response</parameter></paramdef>
  23. <paramdef>void *<parameter>appdata_ptr</parameter></paramdef>
  24. </funcprototype>
  25. </funcsynopsis>
  26. </refsynopsisdiv>
  27. <refsect1 id='misc_conv-description'>
  28. <title>DESCRIPTION</title>
  29. <para>
  30. The <function>misc_conv</function> function is part of
  31. <command>libpam_misc</command> and not of the standard
  32. <command>libpam</command> library. This function will prompt
  33. the user with the appropriate comments and obtain the appropriate
  34. inputs as directed by authentication modules.
  35. </para>
  36. <para>
  37. In addition to simply slotting into the appropriate <citerefentry>
  38. <refentrytitle>pam_conv</refentrytitle><manvolnum>3</manvolnum>
  39. </citerefentry>, this function provides some time-out facilities.
  40. The function exports five variables that can be used by an
  41. application programmer to limit the amount of time this conversation
  42. function will spend waiting for the user to type something. The
  43. five variables are as follows:
  44. </para>
  45. <variablelist>
  46. <varlistentry>
  47. <term><type>time_t</type> <varname>pam_misc_conv_warn_time</varname>;</term>
  48. <listitem>
  49. <para>
  50. This variable contains the <emphasis>time</emphasis> (as
  51. returned by <citerefentry>
  52. <refentrytitle>time</refentrytitle><manvolnum>2</manvolnum>
  53. </citerefentry>) that the user should be first warned that
  54. the clock is ticking. By default it has the value
  55. <returnvalue>0</returnvalue>, which indicates that no such
  56. warning will be given. The application may set its value to
  57. sometime in the future, but this should be done prior to
  58. passing control to the <emphasis>Linux-PAM</emphasis> library.
  59. </para>
  60. </listitem>
  61. </varlistentry>
  62. <varlistentry>
  63. <term><type>const char *</type><varname>pam_misc_conv_warn_line</varname>;</term>
  64. <listitem>
  65. <para>
  66. Used in conjunction with
  67. <varname>pam_misc_conv_warn_time</varname>, this variable is
  68. a pointer to the string that will be displayed when it becomes
  69. time to warn the user that the timeout is approaching. Its
  70. default value is a translated version of
  71. <quote>...Time is running out...</quote>, but this can be
  72. changed by the application prior to passing control to
  73. <emphasis>Linux-PAM</emphasis>.
  74. </para>
  75. </listitem>
  76. </varlistentry>
  77. <varlistentry>
  78. <term><type>time_t</type> <varname>pam_misc_conv_die_time</varname>;</term>
  79. <listitem>
  80. <para>
  81. This variable contains the <emphasis>time</emphasis> (as
  82. returned by <citerefentry>
  83. <refentrytitle>time</refentrytitle><manvolnum>2</manvolnum>
  84. </citerefentry>) that the will time out. By default it has
  85. the value <returnvalue>0</returnvalue>, which indicates that
  86. the conversation function will not timeout. The application
  87. may set its value to sometime in the future, but this should
  88. be done prior to passing control to the
  89. <emphasis>Linux-PAM</emphasis> library.
  90. </para>
  91. </listitem>
  92. </varlistentry>
  93. <varlistentry>
  94. <term><type>const char *</type><varname>pam_misc_conv_die_line</varname>;</term>
  95. <listitem>
  96. <para>
  97. Used in conjunction with
  98. <varname>pam_misc_conv_die_time</varname>, this variable is
  99. a pointer to the string that will be displayed when the
  100. conversation times out. Its default value is a translated
  101. version of
  102. <quote>...Sorry, your time is up!</quote>, but this can be
  103. changed by the application prior to passing control to
  104. <emphasis>Linux-PAM</emphasis>.
  105. </para>
  106. </listitem>
  107. </varlistentry>
  108. <varlistentry>
  109. <term><type>int</type> <varname>pam_misc_conv_died</varname>;</term>
  110. <listitem>
  111. <para>
  112. Following a return from the <emphasis>Linux-PAM</emphasis>
  113. library, the value of this variable indicates whether the
  114. conversation has timed out. A value of
  115. <returnvalue>1</returnvalue> indicates the time-out occurred.
  116. </para>
  117. </listitem>
  118. </varlistentry>
  119. </variablelist>
  120. <para>
  121. The following two function pointers are available for supporting
  122. binary prompts in the conversation function. They are optimized
  123. for the current incarnation of the <command>libpamc</command>
  124. library and are subject to change.
  125. </para>
  126. <variablelist>
  127. <varlistentry>
  128. <term>
  129. <type>int</type> <varname>(*pam_binary_handler_fn)</varname>(<type>void *</type><varname>appdata</varname>, <type>pamc_bp_t *</type><varname>prompt_p</varname>);
  130. </term>
  131. <listitem>
  132. <para>
  133. This function pointer is initialized to
  134. <returnvalue>NULL</returnvalue> but can be filled with a
  135. function that provides machine-machine (hidden) message
  136. exchange. It is intended for use with hidden authentication
  137. protocols such as RSA or Diffie-Hellman key exchanges.
  138. (This is still under development.)
  139. </para>
  140. </listitem>
  141. </varlistentry>
  142. <varlistentry>
  143. <term>
  144. <type>int</type> <varname>(*pam_binary_handler_free)</varname>(<type>void *</type><varname>appdata</varname>, <type>pamc_bp_t *</type><varname>delete_me</varname>);
  145. </term>
  146. <listitem>
  147. <para>
  148. This function pointer is initialized to
  149. <function>PAM_BP_RENEW(delete_me, 0, 0)</function>, but can be
  150. redefined as desired by the application.
  151. </para>
  152. </listitem>
  153. </varlistentry>
  154. </variablelist>
  155. </refsect1>
  156. <refsect1 id='misc_conv-see_also'>
  157. <title>SEE ALSO</title>
  158. <para>
  159. <citerefentry>
  160. <refentrytitle>pam_conv</refentrytitle><manvolnum>3</manvolnum>
  161. </citerefentry>,
  162. <citerefentry>
  163. <refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum>
  164. </citerefentry>
  165. </para>
  166. </refsect1>
  167. <refsect1 id='misc_conv-standards'>
  168. <title>STANDARDS</title>
  169. <para>
  170. The <function>misc_conv</function> function is part of the
  171. <command>libpam_misc</command> Library and not defined in any
  172. standard.
  173. </para>
  174. </refsect1>
  175. </refentry>