Changeset 111 in openpam for trunk/include/security/openpam.h


Ignore:
Timestamp:
Apr 12, 2002, 8:16:08 PM (19 years ago)
Author:
Dag-Erling Smørgrav
Message:

Adopt the same preprocessor tricks that Linux-PAM uses for modules.
This reduces the amount of changes needed to adopt modules written
for Linux-PAM.

Sponsored by: DARPA, NAI Labs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/security/openpam.h

    r106 r111  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/include/security/openpam.h#15 $
     34 * $P4: //depot/projects/openpam/include/security/openpam.h#16 $
    3535 */
    3636
     
    209209
    210210/*
     211 * Source-code compatibility with Linux-PAM modules
     212 */
     213#if defined(PAM_SM_AUTH) || defined(PAM_SM_ACCOUNT) || \
     214        defined(PAM_SM_SESSION) || defined(PAM_SM_PASSWORD)
     215#define LINUX_PAM_MODULE
     216#endif
     217#if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_AUTH)
     218#define _PAM_SM_AUTHENTICATE    0
     219#define _PAM_SM_SETCRED         0
     220#else
     221#undef PAM_SM_AUTH
     222#define PAM_SM_AUTH
     223#define _PAM_SM_AUTHENTICATE    pam_sm_authenticate
     224#define _PAM_SM_SETCRED         pam_sm_setcred
     225#endif
     226#if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_ACCOUNT)
     227#define _PAM_SM_ACCT_MGMT       0
     228#else
     229#undef PAM_SM_ACCOUNT
     230#define PAM_SM_ACCOUNT
     231#define _PAM_SM_ACCT_MGMT       pam_sm_acct_mgmt
     232#endif
     233#if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_SESSION)
     234#define _PAM_SM_OPEN_SESSION    0
     235#define _PAM_SM_CLOSE_SESSION   0
     236#else
     237#undef PAM_SM_SESSION
     238#define PAM_SM_SESSION
     239#define _PAM_SM_OPEN_SESSION    pam_sm_open_session
     240#define _PAM_SM_CLOSE_SESSION   pam_sm_close_session
     241#endif
     242#if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_PASSWORD)
     243#define _PAM_SM_CHAUTHTOK       0
     244#else
     245#undef PAM_SM_PASSWORD
     246#define PAM_SM_PASSWORD
     247#define _PAM_SM_CHAUTHTOK       pam_sm_chauthtok
     248#endif
     249
     250/*
    211251 * Infrastructure for static modules using GCC linker sets.
    212252 * You are not expected to understand this.
     
    228268static char _pam_name[] = name PAM_SOEXT;                               \
    229269static struct pam_module _pam_module = { _pam_name, {                   \
    230     pam_sm_authenticate, pam_sm_setcred, pam_sm_acct_mgmt,              \
    231     pam_sm_open_session, pam_sm_close_session, pam_sm_chauthtok },      \
     270    _PAM_SM_AUTHENTICATE, _PAM_SM_SETCRED, _PAM_SM_ACCT_MGMT,           \
     271    _PAM_SM_OPEN_SESSION, _PAM_SM_CLOSE_SESSION, _PAM_SM_CHAUTHTOK },   \
    232272    NULL, 0, NULL, NULL };                                              \
    233273DATA_SET(_openpam_static_modules, _pam_module)
Note: See TracChangeset for help on using the changeset viewer.