Changeset 111 in openpam


Ignore:
Timestamp:
Apr 12, 2002, 8:16:08 PM (12 years ago)
Author:
des
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

Location:
trunk/include/security
Files:
2 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) 
  • trunk/include/security/pam_modules.h

    r93 r111  
    3232 * SUCH DAMAGE. 
    3333 * 
    34  * $P4: //depot/projects/openpam/include/security/pam_modules.h#6 $ 
     34 * $P4: //depot/projects/openpam/include/security/pam_modules.h#7 $ 
    3535 */ 
    3636 
     
    5050 */ 
    5151 
     52#if defined(PAM_SM_ACCOUNT) 
    5253PAM_EXTERN int 
    5354pam_sm_acct_mgmt(pam_handle_t *_pamh, 
     
    5556        int _argc, 
    5657        const char **_argv); 
     58#endif 
    5759 
     60#if defined(PAM_SM_AUTH) 
    5861PAM_EXTERN int 
    5962pam_sm_authenticate(pam_handle_t *_pamh, 
     
    6164        int _argc, 
    6265        const char **_argv); 
     66#endif 
    6367 
     68#if defined(PAM_SM_PASSWORD) 
    6469PAM_EXTERN int 
    6570pam_sm_chauthtok(pam_handle_t *_pamh, 
     
    6772        int _argc, 
    6873        const char **_argv); 
     74#endif 
    6975 
     76#if defined(PAM_SM_SESSION) 
    7077PAM_EXTERN int 
    7178pam_sm_close_session(pam_handle_t *_pamh, 
     
    7380        int _args, 
    7481        const char **_argv); 
     82#endif 
    7583 
     84#if defined(PAM_SM_SESSION) 
    7685PAM_EXTERN int 
    7786pam_sm_open_session(pam_handle_t *_pamh, 
     
    7988        int _argc, 
    8089        const char **_argv); 
     90#endif 
    8191 
     92#if defined(PAM_SM_AUTH) 
    8293PAM_EXTERN int 
    8394pam_sm_setcred(pam_handle_t *_pamh, 
     
    8596        int _argc, 
    8697        const char **_argv); 
     98#endif 
    8799 
    88100/* 
Note: See TracChangeset for help on using the changeset viewer.