Style cleanup; correct some namespace violations (breaking source
compatibility in the process, but only for OpenPAM-specific features) git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@401 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
parent
e484c931ae
commit
e725df8bb1
|
@ -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); \
|
||||
}
|
||||
|
||||
|
@ -265,6 +270,7 @@ struct pam_module {
|
|||
defined(PAM_SM_SESSION) || defined(PAM_SM_PASSWORD)
|
||||
# define LINUX_PAM_MODULE
|
||||
#endif
|
||||
|
||||
#if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_AUTH)
|
||||
# define _PAM_SM_AUTHENTICATE 0
|
||||
# define _PAM_SM_SETCRED 0
|
||||
|
@ -274,6 +280,7 @@ struct pam_module {
|
|||
# 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
|
||||
#else
|
||||
|
@ -281,6 +288,7 @@ struct pam_module {
|
|||
# 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
|
||||
|
@ -290,6 +298,7 @@ struct pam_module {
|
|||
# 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
|
||||
#else
|
||||
|
@ -305,10 +314,10 @@ struct pam_module {
|
|||
#if defined(__FreeBSD__)
|
||||
# define PAM_SOEXT ".so"
|
||||
#else
|
||||
#ifndef NO_STATIC_MODULES
|
||||
# undef NO_STATIC_MODULES
|
||||
# define NO_STATIC_MODULES
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && !defined(__PIC__) && !defined(NO_STATIC_MODULES)
|
||||
/* gcc, static linking */
|
||||
# include <sys/cdefs.h>
|
||||
|
@ -317,10 +326,17 @@ struct pam_module {
|
|||
# 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 }; \
|
||||
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 */
|
||||
|
@ -332,4 +348,4 @@ DATA_SET(_openpam_static_modules, _pam_module)
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* !SECURITY_OPENPAM_H_INCLUDED */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 <security/pam_types.h>
|
||||
#include <security/pam_constants.h>
|
||||
|
@ -194,4 +194,4 @@ pam_set_mapped_username(pam_handle_t *_pamh,
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* !SECURITY_PAM_APPL_H_INCLUDED */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 <security/openpam_version.h>
|
||||
|
||||
|
@ -132,4 +132,4 @@ enum {
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* !SECURITY_PAM_CONSTANTS_H_INCLUDED */
|
||||
|
|
|
@ -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 <security/pam_types.h>
|
||||
#include <security/pam_constants.h>
|
||||
|
@ -157,4 +157,4 @@ pam_sm_set_mapped_username(pam_handle_t *_pamh,
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* !SECURITY_PAM_MODULES_H_INCLUDED */
|
||||
|
|
|
@ -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 <stddef.h>
|
||||
|
||||
|
@ -84,4 +84,4 @@ typedef struct pam_repository {
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* !SECURITY_PAM_TYPES_H_INCLUDED */
|
||||
|
|
Loading…
Reference in New Issue