diff --git a/include/security/openpam.h b/include/security/openpam.h index 25cf613..dd29794 100644 --- a/include/security/openpam.h +++ b/include/security/openpam.h @@ -34,8 +34,8 @@ * $Id$ */ -#ifndef _SECURITY_OPENPAM_H_INCLUDED -#define _SECURITY_OPENPAM_H_INCLUDED +#ifndef SECURITY_OPENPAM_H_INCLUDED +#define SECURITY_OPENPAM_H_INCLUDED /* * Annoying but necessary header pollution @@ -236,6 +236,11 @@ PAM_EXTERN int \ pam_sm_##type(pam_handle_t *pamh, int flags, \ int argc, const char *argv[]) \ { \ + \ + (void)pamh; \ + (void)flags; \ + (void)argc; \ + (void)argv; \ return (PAM_IGNORE); \ } @@ -263,39 +268,43 @@ struct pam_module { */ #if defined(PAM_SM_AUTH) || defined(PAM_SM_ACCOUNT) || \ defined(PAM_SM_SESSION) || defined(PAM_SM_PASSWORD) -#define LINUX_PAM_MODULE +# define LINUX_PAM_MODULE #endif + #if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_AUTH) -#define _PAM_SM_AUTHENTICATE 0 -#define _PAM_SM_SETCRED 0 +# define _PAM_SM_AUTHENTICATE 0 +# define _PAM_SM_SETCRED 0 #else -#undef PAM_SM_AUTH -#define PAM_SM_AUTH -#define _PAM_SM_AUTHENTICATE pam_sm_authenticate -#define _PAM_SM_SETCRED pam_sm_setcred +# undef PAM_SM_AUTH +# define PAM_SM_AUTH +# define _PAM_SM_AUTHENTICATE pam_sm_authenticate +# define _PAM_SM_SETCRED pam_sm_setcred #endif + #if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_ACCOUNT) -#define _PAM_SM_ACCT_MGMT 0 +# define _PAM_SM_ACCT_MGMT 0 #else -#undef PAM_SM_ACCOUNT -#define PAM_SM_ACCOUNT -#define _PAM_SM_ACCT_MGMT pam_sm_acct_mgmt +# undef PAM_SM_ACCOUNT +# define PAM_SM_ACCOUNT +# define _PAM_SM_ACCT_MGMT pam_sm_acct_mgmt #endif + #if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_SESSION) -#define _PAM_SM_OPEN_SESSION 0 -#define _PAM_SM_CLOSE_SESSION 0 +# define _PAM_SM_OPEN_SESSION 0 +# define _PAM_SM_CLOSE_SESSION 0 #else -#undef PAM_SM_SESSION -#define PAM_SM_SESSION -#define _PAM_SM_OPEN_SESSION pam_sm_open_session -#define _PAM_SM_CLOSE_SESSION pam_sm_close_session +# undef PAM_SM_SESSION +# define PAM_SM_SESSION +# define _PAM_SM_OPEN_SESSION pam_sm_open_session +# define _PAM_SM_CLOSE_SESSION pam_sm_close_session #endif + #if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_PASSWORD) -#define _PAM_SM_CHAUTHTOK 0 +# define _PAM_SM_CHAUTHTOK 0 #else -#undef PAM_SM_PASSWORD -#define PAM_SM_PASSWORD -#define _PAM_SM_CHAUTHTOK pam_sm_chauthtok +# undef PAM_SM_PASSWORD +# define PAM_SM_PASSWORD +# define _PAM_SM_CHAUTHTOK pam_sm_chauthtok #endif /* @@ -303,33 +312,40 @@ struct pam_module { * You are not expected to understand this. */ #if defined(__FreeBSD__) -#define PAM_SOEXT ".so" +# define PAM_SOEXT ".so" #else -#ifndef NO_STATIC_MODULES -#define NO_STATIC_MODULES -#endif +# undef NO_STATIC_MODULES +# define NO_STATIC_MODULES #endif + #if defined(__GNUC__) && !defined(__PIC__) && !defined(NO_STATIC_MODULES) /* gcc, static linking */ -#include -#include -#define OPENPAM_STATIC_MODULES -#define PAM_EXTERN static -#define PAM_MODULE_ENTRY(name) \ -static char _pam_name[] = name PAM_SOEXT; \ -static struct pam_module _pam_module = { _pam_name, { \ - _PAM_SM_AUTHENTICATE, _PAM_SM_SETCRED, _PAM_SM_ACCT_MGMT, \ - _PAM_SM_OPEN_SESSION, _PAM_SM_CLOSE_SESSION, _PAM_SM_CHAUTHTOK }, \ - NULL, 0, NULL, NULL }; \ -DATA_SET(_openpam_static_modules, _pam_module) +# include +# include +# define OPENPAM_STATIC_MODULES +# define PAM_EXTERN static +# define PAM_MODULE_ENTRY(name) \ + static char _pam_name[] = name PAM_SOEXT; \ + static struct pam_module _pam_module = { \ + .path = _pam_name, \ + .func = { \ + [PAM_SM_AUTHENTICATE] = _PAM_SM_AUTHENTICATE, \ + [PAM_SM_SETCRED] = _PAM_SM_SETCRED, \ + [PAM_SM_ACCT_MGMT] = _PAM_SM_ACCT_MGMT, \ + [PAM_SM_OPEN_SESSION] = _PAM_SM_OPEN_SESSION, \ + [PAM_SM_CLOSE_SESSION] = _PAM_SM_CLOSE_SESSION, \ + [PAM_SM_CHAUTHTOK] = _PAM_SM_CHAUTHTOK \ + }, \ + }; \ + DATA_SET(_openpam_static_modules, _pam_module) #else /* normal case */ -#define PAM_EXTERN -#define PAM_MODULE_ENTRY(name) +# define PAM_EXTERN +# define PAM_MODULE_ENTRY(name) #endif #ifdef __cplusplus } #endif -#endif +#endif /* !SECURITY_OPENPAM_H_INCLUDED */ diff --git a/include/security/openpam_version.h b/include/security/openpam_version.h index 1daa2ec..d272fbc 100644 --- a/include/security/openpam_version.h +++ b/include/security/openpam_version.h @@ -34,11 +34,11 @@ * $Id$ */ -#ifndef _OPENPAM_VERSION_H_INCLUDED -#define _OPENPAM_VERSION_H_INCLUDED +#ifndef SECURITY_OPENPAM_VERSION_H_INCLUDED +#define SECURITY_OPENPAM_VERSION_H_INCLUDED -#define _OPENPAM -#define _OPENPAM_VERSION 20050616 -#define _OPENPAM_RELEASE "Figwort" +#define OPENPAM +#define OPENPAM_VERSION 20071218 +#define OPENPAM_RELEASE "Hydrangea" -#endif +#endif /* !SECURITY_OPENPAM_VERSION_H_INCLUDED */ diff --git a/include/security/pam_appl.h b/include/security/pam_appl.h index de7208a..6055a65 100644 --- a/include/security/pam_appl.h +++ b/include/security/pam_appl.h @@ -34,8 +34,8 @@ * $Id$ */ -#ifndef _PAM_APPL_H_INCLUDED -#define _PAM_APPL_H_INCLUDED +#ifndef SECURITY_PAM_APPL_H_INCLUDED +#define SECURITY_PAM_APPL_H_INCLUDED #include #include @@ -194,4 +194,4 @@ pam_set_mapped_username(pam_handle_t *_pamh, } #endif -#endif +#endif /* !SECURITY_PAM_APPL_H_INCLUDED */ diff --git a/include/security/pam_attributes.h b/include/security/pam_attributes.h index 5b52bbe..d686309 100644 --- a/include/security/pam_attributes.h +++ b/include/security/pam_attributes.h @@ -1,5 +1,9 @@ -#ifndef _PAM_ATTRIBUTES_H_INCLUDED -#define _PAM_ATTRIBUTES_H_INCLUDED +/* + * $Id$ + */ + +#ifndef SECURITY_PAM_ATTRIBUTES_H_INCLUDED +#define SECURITY_PAM_ATTRIBUTES_H_INCLUDED /* GCC attributes */ #if defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__STRICT_ANSI__) @@ -21,4 +25,4 @@ # define OPENPAM_NONNULL(params) #endif -#endif /* _PAM_ATTRIBUTES_H_INCLUDED */ +#endif /* !SECURITY_PAM_ATTRIBUTES_H_INCLUDED */ diff --git a/include/security/pam_constants.h b/include/security/pam_constants.h index 3c84189..c351464 100644 --- a/include/security/pam_constants.h +++ b/include/security/pam_constants.h @@ -34,8 +34,8 @@ * $Id$ */ -#ifndef _PAM_CONSTANTS_H_INCLUDED -#define _PAM_CONSTANTS_H_INCLUDED +#ifndef SECURITY_PAM_CONSTANTS_H_INCLUDED +#define SECURITY_PAM_CONSTANTS_H_INCLUDED #include @@ -132,4 +132,4 @@ enum { } #endif -#endif +#endif /* !SECURITY_PAM_CONSTANTS_H_INCLUDED */ diff --git a/include/security/pam_modules.h b/include/security/pam_modules.h index 4452917..2817932 100644 --- a/include/security/pam_modules.h +++ b/include/security/pam_modules.h @@ -34,8 +34,8 @@ * $Id$ */ -#ifndef _PAM_MODULES_H_INCLUDED -#define _PAM_MODULES_H_INCLUDED +#ifndef SECURITY_PAM_MODULES_H_INCLUDED +#define SECURITY_PAM_MODULES_H_INCLUDED #include #include @@ -157,4 +157,4 @@ pam_sm_set_mapped_username(pam_handle_t *_pamh, } #endif -#endif +#endif /* !SECURITY_PAM_MODULES_H_INCLUDED */ diff --git a/include/security/pam_types.h b/include/security/pam_types.h index a428c47..c277227 100644 --- a/include/security/pam_types.h +++ b/include/security/pam_types.h @@ -34,8 +34,8 @@ * $Id$ */ -#ifndef _PAM_TYPES_H_INCLUDED -#define _PAM_TYPES_H_INCLUDED +#ifndef SECURITY_PAM_TYPES_H_INCLUDED +#define SECURITY_PAM_TYPES_H_INCLUDED #include @@ -77,11 +77,11 @@ typedef struct pam_handle pam_handle_t; typedef struct pam_repository { char *type; void *scope; - size_t scope_len; + size_t scope_len; } pam_repository_t; #ifdef __cplusplus } #endif -#endif +#endif /* !SECURITY_PAM_TYPES_H_INCLUDED */