pam_defs.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /**************************************************************************/
  2. /* */
  3. /* Licensed Materials - Property of IBM */
  4. /* */
  5. /* "Restricted Materials of IBM" */
  6. /* */
  7. /* IBM Informix Dynamic Server */
  8. /* (c) Copyright IBM Corporation 1996, 2002 All rights reserved. */
  9. /* */
  10. /**************************************************************************/
  11. /*
  12. * Copyright (c) 1992-2005, by Sun Microsystems, Inc.
  13. * All rights reserved.
  14. */
  15. #ifndef _PAM_DEFS_INCL
  16. #define _PAM_DEFS_INCL
  17. /*
  18. * Limits
  19. */
  20. #define IFX_PAM_MAX_LEN 256
  21. #define IFX_PAM_MAX_ARGS 16
  22. /*
  23. * These are the valid items for pam_get and set calls.
  24. */
  25. #define PAM_SERVICE 1
  26. #define PAM_USER 2
  27. #define PAM_TTY 3
  28. #define PAM_RHOST 4
  29. #define PAM_CONV 5
  30. #define PAM_AUTHTOK 6
  31. #define PAM_OLDAUTHTOK 7
  32. #define PAM_RUSER 8
  33. #define PAM_USER_PROMPT 9
  34. #define PAM_REPOSITORY 10
  35. #define PAM_MAX_ITEM_TYPE 10
  36. #define PAM_MIN_ITEM_TYPE 1
  37. /*
  38. * PAM return values
  39. */
  40. #define PAM_SUCCESS 0
  41. /* Cannot open the module */
  42. #define PAM_OPEN_ERR 1
  43. /* The requested symbol not found in the module */
  44. #define PAM_SYMBOL_ERR 2
  45. /* General purpose error in the service module */
  46. #define PAM_SERVICE_ERR 3
  47. /* General purpose system error */
  48. #define PAM_SYSTEM_ERR 4
  49. /* Memeory allocation error */
  50. #define PAM_BUF_ERR 5
  51. /* Error in the conversation function. Usually a null pointer. */
  52. #define PAM_CONV_ERR 6
  53. /*
  54. * Permission problems. This arises if the module is located
  55. * in an insecure area or if the permissions on the module are insecure
  56. */
  57. #define PAM_PERM_DENIED 7
  58. /* Generally set by the module.*/
  59. #define PAM_IGNORE 8
  60. /* Irrecoverable error in PAM. Application must abort */
  61. #define PAM_ABORT 9
  62. /* Temporary error. Try again. */
  63. #define PAM_TRY_AGAIN 10
  64. /*
  65. * Self explanatory authentication and account problems.
  66. */
  67. #define PAM_USER_UNKNOWN 11
  68. #define PAM_AUTH_ERR 12
  69. #define PAM_AUTHINFO_UNAVAIL 13
  70. #define PAM_MAXTRIES 14
  71. #define PAM_ACCT_EXPIRED 15
  72. /*
  73. * Self explanatory credentials problems.
  74. */
  75. #define PAM_CRED_ERR 16
  76. #define PAM_CRED_EXPIRED 17
  77. #define PAM_CRED_UNAVAIL 18
  78. #define PAM_CRED_INSUFFICIENT 19
  79. /*
  80. * Problems with the authentication token
  81. */
  82. #define PAM_NEW_AUTHTOK_REQD 20
  83. #define PAM_AUTHTOK_EXPIRED 21
  84. #define PAM_AUTHTOK_ERR 22
  85. #define PAM_AUTHTOK_RECOVERY_ERR 23
  86. #define PAM_AUTHTOK_LOCK_BUSY 24
  87. #define PAM_AUTHTOK_DISABLE_AGING 25
  88. /* General error in session management */
  89. #define PAM_SESSION_ERR 27
  90. /*
  91. * Used by set and get data functions of the modules. This should not
  92. * used by applications. Whether the PAM framework is called by the
  93. * user or the module is internally set by the framework.
  94. */
  95. #define PAM_NO_MODULE_DATA 26
  96. #define PAM_TOTAL_ERRNUM 28
  97. #define PAM_MIN_ERRNUM 0
  98. #define PAM_MAX_ERRNUM 27
  99. /*
  100. * The possible message styles, when communicating with the application.
  101. */
  102. /*
  103. * PAM_PROMPT_ECHO_OFF indicates that some confidential info like a
  104. * password is being asked for. So, the application must not echo the
  105. * response.
  106. *
  107. * PAM_TEXT_INFO is general info that is being sent to the application.
  108. */
  109. #define PAM_PROMPT_ECHO_OFF 1
  110. #define PAM_PROMPT_ECHO_ON 2
  111. #define PAM_ERROR_MSG 3
  112. #define PAM_TEXT_INFO 4
  113. /* Limites on the messages */
  114. #define PAM_MAX_NUM_MSG 32
  115. #define PAM_MAX_MSG_SIZE 512
  116. #define PAM_MAX_RESP_SIZE 512
  117. /*
  118. * Valid flags for the PAM functions.
  119. */
  120. #define PAM_SILENT 0x80000000
  121. /* Password cannot be NULL */
  122. #define PAM_DISALLOW_NULL_AUTHTOK 0x1
  123. /* flags for pam_setcred() */
  124. #define PAM_ESTABLISH_CRED 0x1
  125. #define PAM_DELETE_CRED 0x2
  126. #define PAM_REINITIALIZE_CRED 0x4
  127. #define PAM_REFRESH_CRED 0x8
  128. #define PAM_CHANGE_EXPIRED_AUTHTOK 0x4
  129. #endif /* _PAM_DEFS_INCL */