pam_sm_chauthtok.3 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. .\" $XConsortium: pam_sm_chauthtok.3 /main/5 1996/10/29 15:20:04 drk $
  2. .\" Sccs id goes here
  3. '\"macro stdmacro
  4. .\" Copyright (c) 1995, Sun Microsystems, Inc.
  5. .\" All Rights Reserved
  6. .nr X
  7. .TH pam_sm_chauthtok 3 "9 Jan 1996"
  8. .SH NAME
  9. pam_sm_chauthtok
  10. \- Service provider implementation for pam_chauthtok
  11. .SH SYNOPSIS
  12. .LP
  13. .B cc
  14. .RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|."
  15. .B \-lpam
  16. .RI "[ " "library" " \|.\|.\|. ]"
  17. .LP
  18. .nf
  19. .ft 3
  20. #include <security/pam_appl.h>
  21. #include <security/pam_modules.h>
  22. .ft
  23. .fi
  24. .LP
  25. .BI "int pam_sm_chauthtok(pam_handle_t " "*pamh" ,
  26. .BI "const int " "flags");
  27. .SH DESCRIPTION
  28. .IX "pam_authtok" "" "\fLpam_authtok\fP \(em request changing authentication token"
  29. In response to a call to
  30. .BR pam_chauthtok (3)
  31. the PAM framework calls
  32. .BR pam_sm_chauthtok (3)
  33. from the modules listed in the
  34. .BR pam.conf (4)
  35. file.
  36. The password management provider
  37. supplies the back-end functionality for
  38. this interface function.
  39. .PP
  40. .B pam_sm_chauthtok(\|)
  41. changes the authentication token associated with a
  42. particular user referenced by the authentication handle,
  43. .IR pamh.
  44. .LP
  45. The following flag may be passed in to
  46. .BR pam_chauthtok(\|) :
  47. .RS
  48. .IP PAM_SILENT 30
  49. The password service should not generate any messages
  50. .IP PAM_CHANGE_EXPIRED_AUTHTOK 30
  51. The password service should only update those passwords that have aged.
  52. If this flag is not passed, the password service should update all passwords.
  53. .IP PAM_PRELIM_CHECK 30
  54. The password service should only perform preliminary checks.
  55. No passwords should be updated.
  56. .IP PAM_UPDATE_AUTHTOK 30
  57. The password service should update passwords
  58. .RE
  59. .LP
  60. Note that PAM_PRELIM_CHECK and PAM_UPDATE_AUTHTOK can not be
  61. set at the same time.
  62. .LP
  63. Upon successful completion of the call, the authentication
  64. token of the user will be ready for change or will be changed
  65. (depending upon the flag)
  66. in accordance with the authentication scheme
  67. configured within the system.
  68. .PP
  69. The
  70. .I argc
  71. argument
  72. represents the number of module options passed in from the configuration file
  73. .BR pam.conf (4).
  74. .I argv
  75. specifies the module options, which are interpreted and processed
  76. by the password management service. Please refer to the specific
  77. module man pages for the various available
  78. .I options.
  79. .LP
  80. It is the responsibility of
  81. .B pam_sm_chauthtok(\|)
  82. to determine if the new password meets certain strength requirements.
  83. .B pam_sm_chauthtok(\|)
  84. may continue to re-prompt the user (for a limited number of times)
  85. for a new password until the password entered
  86. meets the strength requirements.
  87. .LP
  88. Before returning,
  89. .B pam_sm_chauthtok(\|)
  90. should call
  91. .B pam_get_item(\|)
  92. and retrieve both PAM_AUTHTOK
  93. and PAM_OLDAUTHTOK. If both are NULL,
  94. .B pam_sm_chauthtok(\|)
  95. should set them to the new and old passwords
  96. as entered by the user.
  97. .SH NOTES
  98. The
  99. .SM PAM
  100. framework invokes the password services twice. The first time the modules
  101. are invoked with the flag, PAM_PRELIM_CHECK.
  102. During this stage, the password modules should only perform preliminary
  103. checks (ping remote name services to see if they are
  104. ready for updates, for example). If a password module
  105. detects a transient error (remote name service temporarily down, for example)
  106. it should return PAM_TRY_AGAIN to the
  107. .SM PAM
  108. framework, which
  109. will immediately return the error back to the application.
  110. If all password modules pass the preliminary check, the
  111. .SM PAM
  112. framework invokes the password services again with the flag,
  113. PAM_UPDATE_AUTHTOK. During this stage, each password module should
  114. proceed to update the appropriate password. Any error will again be
  115. reported back to application.
  116. .LP
  117. If a service module receives the flag, PAM_CHANGE_EXPIRED_AUTHTOK,
  118. it should check whether the password has aged or expired.
  119. If the password has aged or expired,
  120. then the service module should proceed to update the password.
  121. If the status indicates that the
  122. password has not yet aged/expired, then the password module
  123. should return PAM_IGNORE.
  124. .LP
  125. If a user's password has aged or expired, a
  126. .SM PAM
  127. account module could save this information as state
  128. in the authentication handle,
  129. pamh, using
  130. .BR pam_set_data(\|) .
  131. The related password management module could retreive this information
  132. using
  133. .B pam_get_data(\|)
  134. to determine whether or not it should prompt
  135. the user to update the password for this particular module.
  136. .SH "RETURN VALUES"
  137. .PP
  138. Upon successful completion, PAM_SUCCESS must be returned.
  139. The following values may also be returned:
  140. .RS
  141. .IP PAM_PERM_DENIED 34
  142. No permission
  143. .IP PAM_AUTHTOK_ERR 34
  144. Authentication token manipulation error
  145. .IP PAM_AUTHTOK_RECOVERY_ERR 34
  146. Old authentication token cannot be recovered
  147. .IP PAM_AUTHTOK_LOCK_BUSY 34
  148. Authentication token lock busy
  149. .IP PAM_AUTHTOK_DISABLE_AGING 34
  150. Authentication token aging disabled
  151. .IP PAM_USER_UNKNOWN 34
  152. User unknown to password service
  153. .IP PAM_TRY_AGAIN 34
  154. Preliminary check by password service failed
  155. .RE
  156. .SH "SEE ALSO"
  157. .BR pam (3),
  158. .BR pam_chauthtok (3),
  159. .BR pam.conf (4)