pam_get_item.3 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. '\" t
  2. .\" Title: pam_get_item
  3. .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
  5. .\" Date: 09/03/2021
  6. .\" Manual: Linux-PAM Manual
  7. .\" Source: Linux-PAM Manual
  8. .\" Language: English
  9. .\"
  10. .TH "PAM_GET_ITEM" "3" "09/03/2021" "Linux-PAM Manual" "Linux-PAM Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. pam_get_item \- getting PAM information
  32. .SH "SYNOPSIS"
  33. .sp
  34. .ft B
  35. .nf
  36. #include <security/pam_modules\&.h>
  37. .fi
  38. .ft
  39. .HP \w'int\ pam_get_item('u
  40. .BI "int pam_get_item(const\ pam_handle_t\ *" "pamh" ", int\ " "item_type" ", const\ void\ **" "item" ");"
  41. .SH "DESCRIPTION"
  42. .PP
  43. The
  44. \fBpam_get_item\fR
  45. function allows applications and PAM service modules to access and retrieve PAM information of
  46. \fIitem_type\fR\&. Upon successful return,
  47. \fIitem\fR
  48. contains a pointer to the value of the corresponding item\&. Note, this is a pointer to the
  49. \fIactual\fR
  50. data and should
  51. \fBnot\fR
  52. be
  53. \fIfree()\fR\*(Aqed or over\-written! The following values are supported for
  54. \fIitem_type\fR:
  55. .PP
  56. PAM_SERVICE
  57. .RS 4
  58. The service name (which identifies that PAM stack that the PAM functions will use to authenticate the program)\&.
  59. .RE
  60. .PP
  61. PAM_USER
  62. .RS 4
  63. The username of the entity under whose identity service will be given\&. That is, following authentication,
  64. \fIPAM_USER\fR
  65. identifies the local entity that gets to use the service\&. Note, this value can be mapped from something (eg\&., "anonymous") to something else (eg\&. "guest119") by any module in the PAM stack\&. As such an application should consult the value of
  66. \fIPAM_USER\fR
  67. after each call to a PAM function\&.
  68. .RE
  69. .PP
  70. PAM_USER_PROMPT
  71. .RS 4
  72. The string used when prompting for a user\*(Aqs name\&. The default value for this string is a localized version of "login: "\&.
  73. .RE
  74. .PP
  75. PAM_TTY
  76. .RS 4
  77. The terminal name: prefixed by
  78. /dev/
  79. if it is a device file; for graphical, X\-based, applications the value for this item should be the
  80. \fI$DISPLAY\fR
  81. variable\&.
  82. .RE
  83. .PP
  84. PAM_RUSER
  85. .RS 4
  86. The requesting user name: local name for a locally requesting user or a remote user name for a remote requesting user\&.
  87. .sp
  88. Generally an application or module will attempt to supply the value that is most strongly authenticated (a local account before a remote one\&. The level of trust in this value is embodied in the actual authentication stack associated with the application, so it is ultimately at the discretion of the system administrator\&.
  89. .sp
  90. \fIPAM_RUSER@PAM_RHOST\fR
  91. should always identify the requesting user\&. In some cases,
  92. \fIPAM_RUSER\fR
  93. may be NULL\&. In such situations, it is unclear who the requesting entity is\&.
  94. .RE
  95. .PP
  96. PAM_RHOST
  97. .RS 4
  98. The requesting hostname (the hostname of the machine from which the
  99. \fIPAM_RUSER\fR
  100. entity is requesting service)\&. That is
  101. \fIPAM_RUSER@PAM_RHOST\fR
  102. does identify the requesting user\&. In some applications,
  103. \fIPAM_RHOST\fR
  104. may be NULL\&. In such situations, it is unclear where the authentication request is originating from\&.
  105. .RE
  106. .PP
  107. PAM_AUTHTOK
  108. .RS 4
  109. The authentication token (often a password)\&. This token should be ignored by all module functions besides
  110. \fBpam_sm_authenticate\fR(3)
  111. and
  112. \fBpam_sm_chauthtok\fR(3)\&. In the former function it is used to pass the most recent authentication token from one stacked module to another\&. In the latter function the token is used for another purpose\&. It contains the currently active authentication token\&.
  113. .RE
  114. .PP
  115. PAM_OLDAUTHTOK
  116. .RS 4
  117. The old authentication token\&. This token should be ignored by all module functions except
  118. \fBpam_sm_chauthtok\fR(3)\&.
  119. .RE
  120. .PP
  121. PAM_CONV
  122. .RS 4
  123. The pam_conv structure\&. See
  124. \fBpam_conv\fR(3)\&.
  125. .RE
  126. .PP
  127. The following additional items are specific to Linux\-PAM and should not be used in portable applications:
  128. .PP
  129. PAM_FAIL_DELAY
  130. .RS 4
  131. A function pointer to redirect centrally managed failure delays\&. See
  132. \fBpam_fail_delay\fR(3)\&.
  133. .RE
  134. .PP
  135. PAM_XDISPLAY
  136. .RS 4
  137. The name of the X display\&. For graphical, X\-based applications the value for this item should be the
  138. \fI$DISPLAY\fR
  139. variable\&. This value may be used independently of
  140. \fIPAM_TTY\fR
  141. for passing the name of the display\&.
  142. .RE
  143. .PP
  144. PAM_XAUTHDATA
  145. .RS 4
  146. A pointer to a structure containing the X authentication data required to make a connection to the display specified by
  147. \fIPAM_XDISPLAY\fR, if such information is necessary\&. See
  148. \fBpam_xauth_data\fR(3)\&.
  149. .RE
  150. .PP
  151. PAM_AUTHTOK_TYPE
  152. .RS 4
  153. The default action is for the module to use the following prompts when requesting passwords: "New UNIX password: " and "Retype UNIX password: "\&. The example word
  154. \fIUNIX\fR
  155. can be replaced with this item, by default it is empty\&. This item is used by
  156. \fBpam_get_authtok\fR(3)\&.
  157. .RE
  158. .PP
  159. If a service module wishes to obtain the name of the user, it should not use this function, but instead perform a call to
  160. \fBpam_get_user\fR(3)\&.
  161. .PP
  162. Only a service module is privileged to read the authentication tokens, PAM_AUTHTOK and PAM_OLDAUTHTOK\&.
  163. .SH "RETURN VALUES"
  164. .PP
  165. PAM_BAD_ITEM
  166. .RS 4
  167. The application attempted to set an undefined or inaccessible item\&.
  168. .RE
  169. .PP
  170. PAM_BUF_ERR
  171. .RS 4
  172. Memory buffer error\&.
  173. .RE
  174. .PP
  175. PAM_PERM_DENIED
  176. .RS 4
  177. The value of
  178. \fIitem\fR
  179. was NULL\&.
  180. .RE
  181. .PP
  182. PAM_SUCCESS
  183. .RS 4
  184. Data was successful updated\&.
  185. .RE
  186. .PP
  187. PAM_SYSTEM_ERR
  188. .RS 4
  189. The
  190. \fIpam_handle_t\fR
  191. passed as first argument was invalid\&.
  192. .RE
  193. .SH "SEE ALSO"
  194. .PP
  195. \fBpam_set_item\fR(3),
  196. \fBpam_strerror\fR(3)