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