_pam_compat.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. #ifndef _PAM_COMPAT_H
  2. #define _PAM_COMPAT_H
  3. /*
  4. * This file was contributed by Derrick J Brashear <shadow@dementia.org>
  5. * slight modification by Brad M. Garcia <bgarcia@fore.com>
  6. *
  7. * A number of operating systems have started to implement PAM.
  8. * unfortunately, they have a different set of numeric values for
  9. * certain constants. This file is included for compatibility's sake.
  10. */
  11. /* Solaris uses different constants. We redefine to those here */
  12. #if defined(solaris) || (defined(__SVR4) && defined(sun))
  13. # ifdef _SECURITY_PAM_MODULES_H
  14. /* flags for pam_chauthtok() */
  15. # undef PAM_PRELIM_CHECK
  16. # define PAM_PRELIM_CHECK 0x1
  17. # undef PAM_UPDATE_AUTHTOK
  18. # define PAM_UPDATE_AUTHTOK 0x2
  19. # endif /* _SECURITY_PAM_MODULES_H */
  20. # ifdef _SECURITY__PAM_TYPES_H
  21. /* generic for pam_* functions */
  22. # undef PAM_SILENT
  23. # define PAM_SILENT 0x80000000
  24. # undef PAM_CHANGE_EXPIRED_AUTHTOK
  25. # define PAM_CHANGE_EXPIRED_AUTHTOK 0x4
  26. /* flags for pam_setcred() */
  27. # undef PAM_ESTABLISH_CRED
  28. # define PAM_ESTABLISH_CRED 0x1
  29. # undef PAM_DELETE_CRED
  30. # define PAM_DELETE_CRED 0x2
  31. # undef PAM_REINITIALIZE_CRED
  32. # define PAM_REINITIALIZE_CRED 0x4
  33. # undef PAM_REFRESH_CRED
  34. # define PAM_REFRESH_CRED 0x8
  35. /* another binary incompatibility comes from the return codes! */
  36. # undef PAM_CONV_ERR
  37. # define PAM_CONV_ERR 6
  38. # undef PAM_PERM_DENIED
  39. # define PAM_PERM_DENIED 7
  40. # undef PAM_MAXTRIES
  41. # define PAM_MAXTRIES 8
  42. # undef PAM_AUTH_ERR
  43. # define PAM_AUTH_ERR 9
  44. # undef PAM_NEW_AUTHTOK_REQD
  45. # define PAM_NEW_AUTHTOK_REQD 10
  46. # undef PAM_CRED_INSUFFICIENT
  47. # define PAM_CRED_INSUFFICIENT 11
  48. # undef PAM_AUTHINFO_UNAVAIL
  49. # define PAM_AUTHINFO_UNAVAIL 12
  50. # undef PAM_USER_UNKNOWN
  51. # define PAM_USER_UNKNOWN 13
  52. # undef PAM_CRED_UNAVAIL
  53. # define PAM_CRED_UNAVAIL 14
  54. # undef PAM_CRED_EXPIRED
  55. # define PAM_CRED_EXPIRED 15
  56. # undef PAM_CRED_ERR
  57. # define PAM_CRED_ERR 16
  58. # undef PAM_ACCT_EXPIRED
  59. # define PAM_ACCT_EXPIRED 17
  60. # undef PAM_AUTHTOK_EXPIRED
  61. # define PAM_AUTHTOK_EXPIRED 18
  62. # undef PAM_SESSION_ERR
  63. # define PAM_SESSION_ERR 19
  64. # undef PAM_AUTHTOK_ERR
  65. # define PAM_AUTHTOK_ERR 20
  66. # undef PAM_AUTHTOK_RECOVERY_ERR
  67. # define PAM_AUTHTOK_RECOVERY_ERR 21
  68. # undef PAM_AUTHTOK_LOCK_BUSY
  69. # define PAM_AUTHTOK_LOCK_BUSY 22
  70. # undef PAM_AUTHTOK_DISABLE_AGING
  71. # define PAM_AUTHTOK_DISABLE_AGING 23
  72. # undef PAM_NO_MODULE_DATA
  73. # define PAM_NO_MODULE_DATA 24
  74. # undef PAM_IGNORE
  75. # define PAM_IGNORE 25
  76. # undef PAM_ABORT
  77. # define PAM_ABORT 26
  78. # undef PAM_TRY_AGAIN
  79. # define PAM_TRY_AGAIN 27
  80. #endif /* _SECURITY__PAM_TYPES_H */
  81. #else
  82. /* For compatibility with old Linux-PAM implementations. */
  83. #define PAM_AUTHTOK_RECOVER_ERR PAM_AUTHTOK_RECOVERY_ERR
  84. #endif /* defined(solaris) || (defined(__SVR4) && defined(sun)) */
  85. #endif /* _PAM_COMPAT_H */